From: pjambhlekar <pushkar.iit@gmail.com>
To: "Laura Abbott" <labbott@redhat.com>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Arve Hjønnevåg" <arve@android.com>,
"Riley Andrews" <riandrews@android.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] Fixing coding guidelines in drivers/staging/android/ion/*
Date: Sun, 26 Feb 2017 22:24:02 +0530 [thread overview]
Message-ID: <1488128042-13880-2-git-send-email-pushkar.iit@gmail.com> (raw)
In-Reply-To: <1488128042-13880-1-git-send-email-pushkar.iit@gmail.com>
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
next prev parent reply other threads:[~2017-02-26 18:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-26 16:54 [PATCH 0/1] Fixing coding guidelines in drivers/staging/android/ion pjambhlekar
2017-02-26 16:54 ` pjambhlekar [this message]
2017-02-26 17:06 ` [PATCH 1/1] Fixing coding guidelines in drivers/staging/android/ion/* Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1488128042-13880-2-git-send-email-pushkar.iit@gmail.com \
--to=pushkar.iit@gmail.com \
--cc=arve@android.com \
--cc=gregkh@linuxfoundation.org \
--cc=labbott@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=riandrews@android.com \
--cc=sumit.semwal@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox