All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: ion: fix code style warning from NULL comparisons
@ 2017-06-27 21:35 Quytelda Kahja
  0 siblings, 0 replies; only message in thread
From: Quytelda Kahja @ 2017-06-27 21:35 UTC (permalink / raw)
  To: labbot, sumit.semwal, gregkh, arve, riandrews
  Cc: devel, linux-kernel, Quytelda Kahja

This patch replaces several instances where a pointer is compared to NULL
(i.e., `ptr == NULL`) with `!ptr`, which is preferred.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 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 43ecb4af1b41..93e2c90fa77d 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -103,7 +103,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;
@@ -161,7 +161,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))
@@ -425,7 +425,7 @@ int ion_alloc(size_t len, unsigned int heap_id_mask, unsigned int flags)
 	}
 	up_read(&dev->lock);
 
-	if (buffer == NULL)
+	if (!buffer)
 		return -ENODEV;
 
 	if (IS_ERR(buffer))
-- 
2.13.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-27 21:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-27 21:35 [PATCH] Staging: ion: fix code style warning from NULL comparisons Quytelda Kahja

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.