提交 f0ca3e87 编写于 作者: P Phong Tran 提交者: Greg Kroah-Hartman

staging: android: ion: ion_cma_heap.c: Fix checkpatch warning

This patch fix coding style:

- Remove "fail memory allocation" waring
- Remove return of void function

Tested by compilation only
Signed-off-by: NPhong Tran <tranmanphong@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 bc0c9da5
...@@ -76,10 +76,8 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer, ...@@ -76,10 +76,8 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
return -EINVAL; return -EINVAL;
info = kzalloc(sizeof(struct ion_cma_buffer_info), GFP_KERNEL); info = kzalloc(sizeof(struct ion_cma_buffer_info), GFP_KERNEL);
if (!info) { if (!info)
dev_err(dev, "Can't allocate buffer info\n");
return ION_CMA_ALLOCATE_FAILED; return ION_CMA_ALLOCATE_FAILED;
}
info->cpu_addr = dma_alloc_coherent(dev, len, &(info->handle), info->cpu_addr = dma_alloc_coherent(dev, len, &(info->handle),
GFP_HIGHUSER | __GFP_ZERO); GFP_HIGHUSER | __GFP_ZERO);
...@@ -90,10 +88,8 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer, ...@@ -90,10 +88,8 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
} }
info->table = kmalloc(sizeof(struct sg_table), GFP_KERNEL); info->table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
if (!info->table) { if (!info->table)
dev_err(dev, "Fail to allocate sg table\n");
goto free_mem; goto free_mem;
}
if (ion_cma_get_sgtable if (ion_cma_get_sgtable
(dev, info->table, info->cpu_addr, info->handle, len)) (dev, info->table, info->cpu_addr, info->handle, len))
...@@ -155,7 +151,6 @@ static struct sg_table *ion_cma_heap_map_dma(struct ion_heap *heap, ...@@ -155,7 +151,6 @@ static struct sg_table *ion_cma_heap_map_dma(struct ion_heap *heap,
static void ion_cma_heap_unmap_dma(struct ion_heap *heap, static void ion_cma_heap_unmap_dma(struct ion_heap *heap,
struct ion_buffer *buffer) struct ion_buffer *buffer)
{ {
return;
} }
static int ion_cma_mmap(struct ion_heap *mapper, struct ion_buffer *buffer, static int ion_cma_mmap(struct ion_heap *mapper, struct ion_buffer *buffer,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册