Skip to contentSkip to conversation

Removes several pointer comparisons to 0 in queue API

PATCH New Tahia Khan 1 participant 4 messages Mar 15, 2017

Subsystems (4)
lore
Share & tools
lore

Tahia Khan

author
#0 lore raw

cover Removes several pointer comparisons to 0 in queue API

Replaces pointer comparisons to 0 with NULL in multiple queue API methods. Identified using coccinelle script 'badzero.cocci'.

Tahia Khan (3):
staging: atomisp: Removes pointer comparison to 0 in
ia_css_queue_enqueue
staging: atomisp: Removes pointer comparison to 0 in
ia_css_queue_dequeue
staging: atomisp: Removes pointer comparison to 0 in
ia_css_queue_get_size

 .../media/atomisp/pci/atomisp2/css2400/runtime/queue/src/queue.c    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/3 staging: atomisp: Removes pointer comparison to 0 in ia_css_queue_enqueue

Repaces pointer comparison to 0 with NULL in ia_css_queue_enqueue to improve code readability. Identified with coccinelle script 'badzero.cocci'.

---
 .../media/atomisp/pci/atomisp2/css2400/runtime/queue/src/queue.c        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/queue/src/queue.c +1 -1
index 06667bd..e4f589f 100644
@@ -88,7 +88,7 @@ int ia_css_queue_enqueue(
 			uint32_t item)
 {
 	int error = 0;
-	if (0 == qhandle)
+	if (NULL == qhandle)
 		return EINVAL;
 
 	/* 1. Load the required queue object */
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 2/3 staging: atomisp: Removes pointer comparison to 0 in ia_css_queue_dequeue

In reply to Tahia Khan

Repaces pointer comparison to 0 with NULL in ia_css_queue_dequeue to improve code readability. Identified with coccinelle script 'badzero.cocci'.

---
 .../media/atomisp/pci/atomisp2/css2400/runtime/queue/src/queue.c        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/queue/src/queue.c +1 -1
index e4f589f..f397a8c 100644
@@ -146,7 +146,7 @@ int ia_css_queue_dequeue(
 			uint32_t *item)
 {
 	int error = 0;
-	if (qhandle == 0 || NULL == item)
+	if (qhandle == NULL || NULL == item)
 		return EINVAL;
 
 	/* 1. Load the required queue object */
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH 3/3 staging: atomisp: Removes pointer comparison to 0 in ia_css_queue_get_size

In reply to Tahia Khan

Repaces pointer comparison to 0 with NULL in ia_css_queue_get_size to improve code readability. Identified with coccinelle script 'badzero.cocci'.

---
 .../media/atomisp/pci/atomisp2/css2400/runtime/queue/src/queue.c        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/queue/src/queue.c +1 -1
index f397a8c..606376f 100644
@@ -383,7 +383,7 @@ int ia_css_queue_get_size(
 			uint32_t *size)
 {
 	int error = 0;
-	if ((qhandle == 0) || (size == NULL))
+	if ((qhandle == NULL) || (size == NULL))
 		return EINVAL;
 
 	/* 1. Load the required queue object */
Signature · 1 line
2.7.4