Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1380858 > unrolled thread

[PATCH 3/4] drivers: staging: remove comparison to NULL

Started bytcharding <me@tobin.cc>
First post2016-04-18 00:40 +0200
Last post2016-04-18 00:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/4] drivers: staging: remove comparison to NULL tcharding <me@tobin.cc> - 2016-04-18 00:40 +0200

#1380858 — [PATCH 3/4] drivers: staging: remove comparison to NULL

Fromtcharding <me@tobin.cc>
Date2016-04-18 00:40 +0200
Subject[PATCH 3/4] drivers: staging: remove comparison to NULL
Message-ID<rp3wd-38T-1@gated-at.bofh.it>
drivers/staging/android/ion/ion.c checkpatch produces
'Comparison to NULL could be written ...' checks. 

This patch replaces comparison to NULL with !var as suggested by checkpatch.

Signed-off-by: tcharding <me@tobin.cc>
---
 drivers/staging/android/ion/ion.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index 4e02209..234848f 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -209,7 +209,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
 	buffer->size = len;
 
 	table = heap->ops->map_dma(heap, buffer);
-	if (WARN_ONCE(table == NULL,
+	if (WARN_ONCE(!table,
 		      "heap->ops->map_dma should return ERR_PTR on error"))
 		table = ERR_PTR(-EINVAL);
 	if (IS_ERR(table)) {
@@ -522,7 +522,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))
@@ -612,7 +612,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))
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web