From: giannis.damigos@gmail.com
To: markus.boehme@mailbox.org, gregkh@linuxfoundation.org
Cc: arve@android.com, riandrews@android.com,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Yannis Damigos <giannis.damigos@gmail.com>
Subject: [PATCHv2 1/5] staging:android:ion: Fix comparison with NULL
Date: Fri, 23 Sep 2016 11:05:13 +0300 [thread overview]
Message-ID: <20160923080517.421-1-giannis.damigos@gmail.com> (raw)
In-Reply-To: <e8f40d73-9d0e-3c18-fcc3-be2bcdf0eaf3@mailbox.org>
From: Yannis Damigos <giannis.damigos@gmail.com>
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@gmail.com>
---
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
next prev parent reply other threads:[~2016-09-23 8:05 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-22 17:55 [PATCH] staging:android:io: Fix multiple styling issues Yannis Damigos
2016-09-22 18:22 ` Markus Böhme
2016-09-23 8:05 ` giannis.damigos [this message]
2016-09-23 8:05 ` [PATCHv2 2/5] staging:android:ion: Fix whitespace issues giannis.damigos
2016-09-23 12:17 ` Greg KH
2016-09-23 8:05 ` [PATCHv2 3/5] staging:android:ion: Fix blank line issues giannis.damigos
2016-09-23 12:17 ` Greg KH
2016-09-23 13:26 ` Yannis Damigos
2016-09-23 15:06 ` Greg KH
2016-09-23 8:05 ` [PATCHv2 4/5] staging:android:ion: Fix switch case indentation giannis.damigos
2016-09-23 8:05 ` [PATCHv2 5/5] staging:android:ion: Fix void function return giannis.damigos
2016-09-23 8:44 ` Greg KH
2016-09-23 9:50 ` [PATCHv3 5/5] staging:android:ion: Remove empty release function Yannis Damigos
2016-09-23 12:06 ` Greg KH
2016-09-23 13:50 ` Yannis Damigos
2016-09-26 10:11 ` Yannis Damigos
2016-09-26 10:24 ` Greg KH
2016-09-26 10:30 ` Yannis Damigos
2016-09-23 12:18 ` Greg KH
2016-09-27 7:38 ` [PATCHv4 1/4] staging:android:ion: Fix comparison with NULL Yannis Damigos
2016-09-27 7:38 ` [PATCHv4 2/4] staging:android:ion: Fix alignment issues Yannis Damigos
2016-09-27 7:38 ` [PATCHv4 3/4] staging:android:ion: Fix blank line issues Yannis Damigos
2016-09-27 7:38 ` [PATCHv4 4/4] staging:android:ion: Fix whitespace issue Yannis Damigos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160923080517.421-1-giannis.damigos@gmail.com \
--to=giannis.damigos@gmail.com \
--cc=arve@android.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=markus.boehme@mailbox.org \
--cc=riandrews@android.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®