Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1560698

[PATCH 08/13] MIPS: ralink: fix request_mem_region error handling

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject [PATCH 08/13] MIPS: ralink: fix request_mem_region error handling
Date 2017-01-17 16:30 +0100
Message-ID <t0DRU-jr-19@gated-at.bofh.it> (permalink)
References <t0DRU-jr-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 08/13] MIPS: ralink: fix request_mem_region error handling Arnd Bergmann <arnd@arndb.de> - 2017-01-17 16:30 +0100

csiph-web