linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org, Arnd Bergmann <arnd@arndb.de>,
	John Crispin <john@phrozen.org>, Tobias Wolf <dev-NTEO@vplace.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 08/13] MIPS: ralink: fix request_mem_region error handling
Date: Tue, 17 Jan 2017 16:18:42 +0100	[thread overview]
Message-ID: <20170117151911.4109452-8-arnd@arndb.de> (raw)
In-Reply-To: <20170117151911.4109452-1-arnd@arndb.de>

request_mem_region returns a NULL pointer on error, comparing it
against a number results in a warning:

arch/mips/ralink/of.c: In function 'plat_of_remap_node':
arch/mips/ralink/of.c:45:15: error: ordered comparison of pointer with integer zero [-Werror=extra]
arch/mips/ralink/irq.c: In function 'intc_of_init':
arch/mips/ralink/irq.c:167:15: error: ordered comparison of pointer with integer zero [-Werror=extra]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/ralink/irq.c | 4 ++--
 arch/mips/ralink/of.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/mips/ralink/irq.c b/arch/mips/ralink/irq.c
index 4911c1445f1a..9b478c95aaf5 100644
--- a/arch/mips/ralink/irq.c
+++ b/arch/mips/ralink/irq.c
@@ -163,8 +163,8 @@ static int __init intc_of_init(struct device_node *node,
 	if (of_address_to_resource(node, 0, &res))
 		panic("Failed to get intc memory range");
 
-	if (request_mem_region(res.start, resource_size(&res),
-				res.name) < 0)
+	if (!request_mem_region(res.start, resource_size(&res),
+				res.name))
 		pr_err("Failed to request intc memory");
 
 	rt_intc_membase = ioremap_nocache(res.start,
diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c
index 4c843e039b96..1ada8492733b 100644
--- a/arch/mips/ralink/of.c
+++ b/arch/mips/ralink/of.c
@@ -40,9 +40,9 @@ __iomem void *plat_of_remap_node(const char *node)
 	if (of_address_to_resource(np, 0, &res))
 		panic("Failed to get resource for %s", node);
 
-	if ((request_mem_region(res.start,
+	if (!request_mem_region(res.start,
 				resource_size(&res),
-				res.name) < 0))
+				res.name))
 		panic("Failed to request resources for %s", node);
 
 	return ioremap_nocache(res.start, resource_size(&res));
-- 
2.9.0

  parent reply	other threads:[~2017-01-17 15:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
2017-01-17 15:18 ` [PATCH 02/13] MIPS: VDSO: avoid duplicate CAC_BASE definition Arnd Bergmann
2017-01-17 15:18 ` [PATCH 03/13] MIPS: 'make -s' should be silent Arnd Bergmann
2017-01-17 15:18 ` [PATCH 04/13] MIPS: zboot: fix 'make clean' failure Arnd Bergmann
2017-01-18  9:43   ` Sergei Shtylyov
2017-01-18  9:48     ` Arnd Bergmann
2017-01-17 15:18 ` [PATCH 05/13] MIPS: alchemy: remove duplicate initializer Arnd Bergmann
2017-01-17 15:18 ` [PATCH 06/13] MIPS: Lantiq: Fix another request_mem_region() return code check Arnd Bergmann
2017-01-17 15:18 ` [PATCH 07/13] MIPS: ralink: remove unused timer functions Arnd Bergmann
2017-01-17 15:18 ` Arnd Bergmann [this message]
2017-01-17 15:18 ` [PATCH 09/13] MIPS: ralink: remove unused rt*_wdt_reset functions Arnd Bergmann
2017-01-17 15:18 ` [PATCH 10/13] MIPS: loongson64: fix empty-body warning in dma_alloc Arnd Bergmann
2017-01-17 15:18 ` [PATCH 11/13] MIPS: octeon: avoid empty-body warning Arnd Bergmann
2017-01-17 20:00   ` David Daney
2017-01-17 20:00     ` David Daney
2017-01-17 15:18 ` [PATCH 12/13] MIPS: ip22: fix ip28 build for modern gcc Arnd Bergmann
2017-01-17 15:18 ` [PATCH 13/13] MIPS: avoid old-style declaration Arnd Bergmann

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=20170117151911.4109452-8-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=dev-NTEO@vplace.de \
    --cc=john@phrozen.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /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;
as well as URLs for NNTP newsgroup(s).