From 9f9605c2eda9679e6f63c605cbd9cbf6a9a7f3fa Mon Sep 17 00:00:00 2001 From: Russell King Date: Fri, 7 Jan 2011 11:57:44 +0000 Subject: omap2+: Fix unused variable warning for omap_irq_base Commit 5d190c40100793a6dfc37bf325677c10f3c80edf (omap2+: Initialize omap_irq_base for entry-macro.S from platform code) simplified the handling of omap_irq_base for multi-omap builds. However, this patch also introduced a build warning for !MULTI_OMAP2 builds: arch/arm/mach-omap2/io.c: In function 'omap_irq_base_init': arch/arm/mach-omap2/io.c:322: warning: unused variable 'omap_irq_base' Fix this by removing the ifdef. Also simplify things further by moving omap_irq_base out of entry-macro.S. Signed-off-by: Russell King [tony@atomide.com: updated comments] Signed-off-by: Tony Lindgren diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S index befa321..81985a6 100644 --- a/arch/arm/mach-omap2/include/mach/entry-macro.S +++ b/arch/arm/mach-omap2/include/mach/entry-macro.S @@ -38,20 +38,6 @@ */ #ifdef MULTI_OMAP2 - -/* - * We use __glue to avoid errors with multiple definitions of - * .globl omap_irq_base as it's included from entry-armv.S but not - * from entry-common.S. - */ -#ifdef __glue - .pushsection .data - .globl omap_irq_base -omap_irq_base: - .word 0 - .popsection -#endif - /* * Configure the interrupt base on the first interrupt. * See also omap_irq_base_init for setting omap_irq_base. diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index e66687b..c203204 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c @@ -314,14 +314,13 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data) return omap_hwmod_set_postsetup_state(oh, *(u8 *)data); } +void __iomem *omap_irq_base; + /* * Initialize asm_irq_base for entry-macro.S */ static inline void omap_irq_base_init(void) { - extern void __iomem *omap_irq_base; - -#ifdef MULTI_OMAP2 if (cpu_is_omap24xx()) omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE); else if (cpu_is_omap34xx()) @@ -330,7 +329,6 @@ static inline void omap_irq_base_init(void) omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE); else pr_err("Could not initialize omap_irq_base\n"); -#endif } void __init omap2_init_common_infrastructure(void) -- cgit v0.10.2 From efe318a333767cbd20746f8d57f3ca7e398d9255 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Thu, 27 Jan 2011 15:52:16 -0800 Subject: omap1: Simplify use of omap_irq_flags Commit 03a9e5126147c9f92aeba4b34f62b15b625087fb (omap1: Use asm_irq_flags for entry-macro.S) added support for multi-omap builds with addition of the omap_irq_flags. Commit 9f9605c2eda9679e6f63c605cbd9cbf6a9a7f3fa (omap2+: Fix unused variable warning for omap_irq_base) simplified omap2+ entry-macro.S by moving omap_irq_flags out of entry-macro.S. Simplify omap1 entry-macro.S in a similar way to keep the code consistent. Based on a similar earlier patch for omap2+ by Russell King . Signed-off-by: Tony Lindgren diff --git a/arch/arm/mach-omap1/include/mach/entry-macro.S b/arch/arm/mach-omap1/include/mach/entry-macro.S index c9be6d4..bfb4fb1 100644 --- a/arch/arm/mach-omap1/include/mach/entry-macro.S +++ b/arch/arm/mach-omap1/include/mach/entry-macro.S @@ -14,19 +14,6 @@ #include #include -/* - * We use __glue to avoid errors with multiple definitions of - * .globl omap_irq_flags as it's included from entry-armv.S but not - * from entry-common.S. - */ -#ifdef __glue - .pushsection .data - .globl omap_irq_flags -omap_irq_flags: - .word 0 - .popsection -#endif - .macro disable_fiq .endm diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c index 4770158..731dd33 100644 --- a/arch/arm/mach-omap1/irq.c +++ b/arch/arm/mach-omap1/irq.c @@ -57,6 +57,7 @@ struct omap_irq_bank { unsigned long wake_enable; }; +u32 omap_irq_flags; static unsigned int irq_bank_count; static struct omap_irq_bank *irq_banks; @@ -176,7 +177,6 @@ static struct irq_chip omap_irq_chip = { void __init omap_init_irq(void) { - extern unsigned int omap_irq_flags; int i, j; #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) -- cgit v0.10.2 From afb7d7099e27f30caf69b3ce80a4cb86612a0b87 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Mon, 17 Jan 2011 06:31:18 +0200 Subject: arm: omap2: mux: fix compile warning Commit 8419fdbaf2118a0a169441be82f09f7be93a5ca1 (omap2+: Add omap_mux_get_by_name) introduced the following compile warning: arch/arm/mach-omap2/mux.c: In function '_omap_mux_get_by_name': arch/arm/mach-omap2/mux.c:163:17: warning: 'found_mode' may be used uninitialized in this function Signed-off-by: Felipe Balbi [tony@atomide.com: updated comments] Signed-off-by: Tony Lindgren diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index df8d2f2..fae49d1 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c @@ -160,7 +160,7 @@ static int __init _omap_mux_get_by_name(struct omap_mux_partition *partition, struct omap_mux *mux = NULL; struct omap_mux_entry *e; const char *mode_name; - int found = 0, found_mode, mode0_len = 0; + int found = 0, found_mode = 0, mode0_len = 0; struct list_head *muxmodes = &partition->muxmodes; mode_name = strchr(muxname, '.'); -- cgit v0.10.2 From 0e6d8cad448bde3d846961bb43db15daae94562e Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Thu, 27 Jan 2011 15:49:06 +0000 Subject: arch/arm/mach-omap2/dma.c: Convert IS_ERR result to PTR_ERR This code elsewhere returns a negative constant to an indicate an error, while IS_ERR returns the result of a >= operation. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ if (...) { ... - return IS_ERR(x); + return PTR_ERR(x); } // Signed-off-by: Julia Lawall Acked-by: Jarkko Nikula Signed-off-by: Tony Lindgren diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c index d2f15f5..34922b2 100644 --- a/arch/arm/mach-omap2/dma.c +++ b/arch/arm/mach-omap2/dma.c @@ -264,7 +264,7 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused) if (IS_ERR(od)) { pr_err("%s: Cant build omap_device for %s:%s.\n", __func__, name, oh->name); - return IS_ERR(od); + return PTR_ERR(od); } mem = platform_get_resource(&od->pdev, IORESOURCE_MEM, 0); -- cgit v0.10.2