From: Yannis Damigos Date: Tue, 27 Sep 2016 07:38:23 +0000 (+0300) Subject: staging:android:ion: Fix comparison with NULL X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=66fa610095f758d1793a30d1cd57a0c1432258e2;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging:android:ion: Fix comparison with NULL 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/android/ion/ion_of.c b/drivers/staging/android/ion/ion_of.c index 826e756452d0..a8050c6241fb 100644 --- a/drivers/staging/android/ion/ion_of.c +++ b/drivers/staging/android/ion/ion_of.c @@ -31,12 +31,12 @@ static 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;