[PATCHv2 1/5] staging:android:ion: Fix comparison with NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Yannis Damigos <giannis.damigos@xxxxxxxxx>

This patch fixes the following comparison with NULL issues:

CHECK: Comparison to NULL could be written "compatible[i].name"
+	for (i = 0; compatible[i].name != NULL; i++) {

CHECK: Comparison to NULL could be written "!compatible[i].name"
+	if (compatible[i].name == NULL)

Signed-off-by: Yannis Damigos <giannis.damigos@xxxxxxxxx>
---
 drivers/staging/android/ion/ion_of.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/ion/ion_of.c b/drivers/staging/android/ion/ion_of.c
index de0899a..b3da8d8 100644
--- a/drivers/staging/android/ion/ion_of.c
+++ b/drivers/staging/android/ion/ion_of.c
@@ -31,12 +31,12 @@ int ion_parse_dt_heap_common(struct device_node *heap_node,
 {
 	int i;
 
-	for (i = 0; compatible[i].name != NULL; i++) {
+	for (i = 0; compatible[i].name; i++) {
 		if (of_device_is_compatible(heap_node, compatible[i].compat))
 			break;
 	}
 
-	if (compatible[i].name == NULL)
+	if (!compatible[i].name)
 		return -ENODEV;
 
 	heap->id = compatible[i].heap_id;
-- 
2.10.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux