Skip to contentSkip to conversation

Fix compiler warnings in gpmc.c

PATCH In review Sanjeev Premi 3 participants 5 messages Oct 10, 2008 – Oct 16, 2008

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix compiler warnings in gpmc.c

Fix these compiler warnings:

gpmc.c: In function 'gpmc_init':
gpmc.c:432: warning: 'return' with a value, in function returning void gpmc.c:439: warning: 'return' with a value, in function returning void

---
 arch/arm/mach-omap2/gpmc.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/gpmc.c +2 -4
index f3e0271..4365c59 100644
@@ -429,18 +429,16 @@ void __init gpmc_init(void)
 	gpmc_l3_clk = clk_get(NULL, ck);
 	if (IS_ERR(gpmc_l3_clk)) {
 		printk(KERN_ERR "Could not get GPMC clock %s\n", ck);
-		return -ENODEV;
+		BUG();
 	}
 
 	gpmc_base = ioremap(l, SZ_4K);
 	if (!gpmc_base) {
 		clk_put(gpmc_l3_clk);
 		printk(KERN_ERR "Could not get GPMC register memory\n");
-		return -ENOMEM;
+		BUG();
 	}
 
-	BUG_ON(IS_ERR(gpmc_l3_clk));
-
 	l = gpmc_read_reg(GPMC_REVISION);
 	printk(KERN_INFO "GPMC revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f);
 	/* Set smart idle mode and automatic L3 clock gating */
Signature · 1 line
1.5.6
maintainer
#1 lore raw
Quoted 5 lines · Sanjeev Premi

Fix these compiler warnings:

gpmc.c: In function 'gpmc_init':
gpmc.c:432: warning: 'return' with a value, in function returning void gpmc.c:439: warning: 'return' with a value, in function returning void

Pushing.

Tony

Quoted 37 lines
---
 arch/arm/mach-omap2/gpmc.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/gpmc.c +2 -4
index f3e0271..4365c59 100644
@@ -429,18 +429,16 @@ void __init gpmc_init(void)
 	gpmc_l3_clk = clk_get(NULL, ck);
 	if (IS_ERR(gpmc_l3_clk)) {
 		printk(KERN_ERR "Could not get GPMC clock %s\n", ck);
-		return -ENODEV;
+		BUG();
 	}
 
 	gpmc_base = ioremap(l, SZ_4K);
 	if (!gpmc_base) {
 		clk_put(gpmc_l3_clk);
 		printk(KERN_ERR "Could not get GPMC register memory\n");
-		return -ENOMEM;
+		BUG();
 	}
 
-	BUG_ON(IS_ERR(gpmc_l3_clk));
-
 	l = gpmc_read_reg(GPMC_REVISION);
 	printk(KERN_INFO "GPMC revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f);
 	/* Set smart idle mode and automatic L3 clock gating */
Signature · 6 lines
1.5.6

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#4 lore raw
Quoted 8 lines · Tony Lindgren
Quoted 4 lines · Pakaravoor, Jagadeesh

What was wrong with this patch?

http://marc.info/?l=linux-omap&m=122277286326989&w=2

Hmm, looks like I forgot again we already had a patch for that, sorry :) I'll take a better look on Tuesday.

Hmm, looks like your's is missing clk_put(), so let's keep what I already pushed.

Cheers,

Tony