[PATCH 1/1] Fixing coding guidelines in drivers/staging/android/ion/*

pjambhlekar
2017-02-26T18:49:13Z

Signed-off-by: pjambhlekar <pushkar.iit@gmail.com>
---
drivers/staging/android/ion/ion-ioctl.c | 2 +-
drivers/staging/android/ion/ion.c | 8 ++++----
drivers/staging/android/ion/ion_cma_heap.c | 3 +--
drivers/staging/android/ion/ion_dummy_driver.c | 2 +-
drivers/staging/android/ion/ion_system_heap.c | 2 --
5 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/android/ion/ion-ioctl.c b/drivers/staging/android/ion/ion-ioctl.c
index 9ff815a..4435a95 100644
--- a/drivers/staging/android/ion/ion-ioctl.c
+++ b/drivers/staging/android/ion/ion-ioctl.c
@@ -95,7 +95,7 @@ long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
struct ion_handle *handle;

handle = ion_alloc(client, data.allocation.len,
- data.allocation.align,
+ data.allocation.align,
data.allocation.heap_id_mask,
data.allocation.flags);
if (IS_ERR(handle))
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 2c3ffbc..c24795d 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -131,7 +131,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
goto err2;
}

- if (buffer->sg_table == NULL) {
+ if (!buffer->sg_table) {
WARN_ONCE(1, "This heap needs to set the sgtable");
ret = -EINVAL;
goto err1;
@@ -350,7 +350,7 @@ struct ion_handle *ion_handle_get_by_id_nolock(struct ion_client *client,
}

struct ion_handle *ion_handle_get_by_id(struct ion_client *client,
- int id)
+ int id)
{
struct ion_handle *handle;

@@ -433,7 +433,7 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
}
up_read(&dev->lock);

- if (buffer == NULL)
+ if (!buffer)
return ERR_PTR(-ENODEV);

if (IS_ERR(buffer))
@@ -491,7 +491,7 @@ static void *ion_buffer_kmap_get(struct ion_buffer *buffer)
return buffer->vaddr;
}
vaddr = buffer->heap->ops->map_kernel(buffer->heap, buffer);
- if (WARN_ONCE(vaddr == NULL,
+ if (WARN_ONCE(!vaddr,
"heap->ops->map_kernel should return ERR_PTR on error"))
return ERR_PTR(-EINVAL);
if (IS_ERR(vaddr))
diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c
index 6c40685..13e8031 100644
--- a/drivers/staging/android/ion/ion_cma_heap.c
+++ b/drivers/staging/android/ion/ion_cma_heap.c
@@ -37,7 +37,6 @@ struct ion_cma_buffer_info {
struct sg_table *table;
};

-
/* ION CMA heap operations functions */
static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
unsigned long len, unsigned long align,
@@ -59,7 +58,7 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
if (!info)
return -ENOMEM;

- info->cpu_addr = dma_alloc_coherent(dev, len, &(info->handle),
+ info->cpu_addr = dma_alloc_coherent(dev, len, &info->handle,
GFP_HIGHUSER | __GFP_ZERO);

if (!info->cpu_addr) {
diff --git a/drivers/staging/android/ion/ion_dummy_driver.c b/drivers/staging/android/ion/ion_dummy_driver.c
index cf5c010..48913c7 100644
--- a/drivers/staging/android/ion/ion_dummy_driver.c
+++ b/drivers/staging/android/ion/ion_dummy_driver.c
@@ -75,7 +75,6 @@ static int __init ion_dummy_init(void)
if (!heaps)
return -ENOMEM;

-
/* Allocate a dummy carveout heap */
carveout_ptr = alloc_pages_exact(
dummy_heaps[ION_HEAP_TYPE_CARVEOUT].size,
@@ -153,4 +152,5 @@ static void __exit ion_dummy_exit(void)
chunk_ptr = NULL;
}
}
+
__exitcall(ion_dummy_exit);
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
index 3ebbb75..9416d82 100644
--- a/drivers/staging/android/ion/ion_system_heap.c
+++ b/drivers/staging/android/ion/ion_system_heap.c
@@ -102,7 +102,6 @@ static void free_buffer_page(struct ion_system_heap *heap,
ion_page_pool_free(pool, page);
}

-
static struct page *alloc_largest_available(struct ion_system_heap *heap,
struct ion_buffer *buffer,
unsigned long size,
@@ -263,7 +262,6 @@ static struct ion_heap_ops system_heap_ops = {
static int ion_system_heap_debug_show(struct ion_heap *heap, struct seq_file *s,
void *unused)
{
-
struct ion_system_heap *sys_heap = container_of(heap,
struct ion_system_heap,
heap);
--
2.7.4