All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: tony@atomide.com
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	llvmlinux@lists.linuxfoundation.org,
	Stefan Agner <stefan@agner.ch>
Subject: [PATCH] arm: mach-omap2: remove superfluous NULL pointer check
Date: Sun, 22 Mar 2015 01:00:18 +0100	[thread overview]
Message-ID: <1426982418-9649-1-git-send-email-stefan@agner.ch> (raw)

The NULL pointer check for superset->muxnames will always evaluate
true since muxnames is an array within struct omap_mux. Remove the
superfluous check to avoid warnings when using LLVM/clang.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
For the reference, the warning generated by LLVM/clang:
arch/arm/mach-omap2/mux.c:1056:18: warning: address of array
'superset->muxnames' will always evaluate to 'true' [-Wpointer-bool-conversion]
                if (!superset->muxnames || !superset->muxnames[0]) {
                    ~~~~~~~~~~~^~~~~~~~

 arch/arm/mach-omap2/mux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 78064b0..176eef6 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -1053,7 +1053,7 @@ static void __init omap_mux_init_list(struct omap_mux_partition *partition,
 		struct omap_mux *entry;
 
 #ifdef CONFIG_OMAP_MUX
-		if (!superset->muxnames || !superset->muxnames[0]) {
+		if (!superset->muxnames[0]) {
 			superset++;
 			continue;
 		}
-- 
2.3.3


WARNING: multiple messages have this Message-ID (diff)
From: stefan@agner.ch (Stefan Agner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: mach-omap2: remove superfluous NULL pointer check
Date: Sun, 22 Mar 2015 01:00:18 +0100	[thread overview]
Message-ID: <1426982418-9649-1-git-send-email-stefan@agner.ch> (raw)

The NULL pointer check for superset->muxnames will always evaluate
true since muxnames is an array within struct omap_mux. Remove the
superfluous check to avoid warnings when using LLVM/clang.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
For the reference, the warning generated by LLVM/clang:
arch/arm/mach-omap2/mux.c:1056:18: warning: address of array
'superset->muxnames' will always evaluate to 'true' [-Wpointer-bool-conversion]
                if (!superset->muxnames || !superset->muxnames[0]) {
                    ~~~~~~~~~~~^~~~~~~~

 arch/arm/mach-omap2/mux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 78064b0..176eef6 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -1053,7 +1053,7 @@ static void __init omap_mux_init_list(struct omap_mux_partition *partition,
 		struct omap_mux *entry;
 
 #ifdef CONFIG_OMAP_MUX
-		if (!superset->muxnames || !superset->muxnames[0]) {
+		if (!superset->muxnames[0]) {
 			superset++;
 			continue;
 		}
-- 
2.3.3

             reply	other threads:[~2015-03-22  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-22  0:00 Stefan Agner [this message]
2015-03-22  0:00 ` [PATCH] arm: mach-omap2: remove superfluous NULL pointer check Stefan Agner
2015-03-26 17:34 ` Tony Lindgren
2015-03-26 17:34   ` Tony Lindgren

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=1426982418-9649-1-git-send-email-stefan@agner.ch \
    --to=stefan@agner.ch \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=llvmlinux@lists.linuxfoundation.org \
    --cc=tony@atomide.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 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.