Skip to contentSkip to conversation

ARM: davinci: sparse warning fixes

PATCH New Sekhar Nori 1 participant 6 messages Apr 10, 2013 – Apr 15, 2013

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

cover ARM: davinci: sparse warning fixes

This patch series fixes some sparse errors/warnings occurring in arch/arm/mach-davinci/*

Tested on DA850 EVM (boot and suspend-to-RAM test).

Sekhar Nori (4):
ARM: davinci: da850 evm: fix const qualifier placement
ARM: davinci: da8xx dt: make file local symbols static
ARM: davinci: sram.c: fix incorrect type in assignment
ARM: davinci: ensure global variables are declared

 arch/arm/mach-davinci/board-da850-evm.c |    4 ++--
 arch/arm/mach-davinci/da8xx-dt.c        |    4 ++--
 arch/arm/mach-davinci/pm.c              |    1 +
 arch/arm/mach-davinci/sram.c            |    4 ++--
 arch/arm/mach-davinci/usb.c             |    1 +
 5 files changed, 8 insertions(+), 6 deletions(-)
Signature · 1 line
1.7.10.1
#1 lore raw

PATCH 1/4 ARM: davinci: da850 evm: fix const qualifier placement

const qualifier was misplaced in couple of definitions. This fixes the sparse error:

CHECK arch/arm/mach-davinci/board-mityomapl138.c
arch/arm/mach-davinci/board-da850-evm.c:404:19: error: Just how const do you want this type to be? arch/arm/mach-davinci/board-da850-evm.c:568:19: error: Just how const do you want this type to be?

---
 arch/arm/mach-davinci/board-da850-evm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-davinci/board-da850-evm.c +2 -2
index c2dfe06..1f597b3 100644
@@ -401,7 +401,7 @@ enum da850_evm_ui_exp_pins {
 	DA850_EVM_UI_EXP_PB1,
 };
 
-static const char const *da850_evm_ui_exp[] = {
+static const char * const da850_evm_ui_exp[] = {
 	[DA850_EVM_UI_EXP_SEL_C]        = "sel_c",
 	[DA850_EVM_UI_EXP_SEL_B]        = "sel_b",
 	[DA850_EVM_UI_EXP_SEL_A]        = "sel_a",
@@ -565,7 +565,7 @@ enum da850_evm_bb_exp_pins {
 	DA850_EVM_BB_EXP_USER_SW8
 };
 
-static const char const *da850_evm_bb_exp[] = {
+static const char * const da850_evm_bb_exp[] = {
 	[DA850_EVM_BB_EXP_DEEP_SLEEP_EN]	= "deep_sleep_en",
 	[DA850_EVM_BB_EXP_SW_RST]		= "sw_rst",
 	[DA850_EVM_BB_EXP_TP_23]		= "tp_23",
Signature · 1 line
1.7.10.1
#2 lore raw

PATCH 2/4 ARM: davinci: da8xx dt: make file local symbols static

In reply to Sekhar Nori

Make some file-local functions static. This fixes the sparse warnings:

CHECK arch/arm/mach-davinci/da8xx-dt.c
arch/arm/mach-davinci/da8xx-dt.c:23:13: warning: symbol 'da8xx_uart_clk_enable' was not declared. Should it be static? arch/arm/mach-davinci/da8xx-dt.c:40:23: warning: symbol 'da850_auxdata_lookup' was not declared. Should it be static?

---
 arch/arm/mach-davinci/da8xx-dt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-davinci/da8xx-dt.c +2 -2
index 6b7a0a2..57e14a8 100644
@@ -20,7 +20,7 @@
 
 #define DA8XX_NUM_UARTS	3
 
-void __init da8xx_uart_clk_enable(void)
+static void __init da8xx_uart_clk_enable(void)
 {
 	int i;
 	for (i = 0; i < DA8XX_NUM_UARTS; i++)
@@ -37,7 +37,7 @@ static void __init da8xx_init_irq(void)
 	of_irq_init(da8xx_irq_match);
 }
 
-struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
+static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL),
 	OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL),
 	{}
Signature · 1 line
1.7.10.1
#3 lore raw

PATCH 3/4 ARM: davinci: sram.c: fix incorrect type in assignment

In reply to Sekhar Nori

Fix missing __iomem attribute. This fixes the sparse warning:

CHECK arch/arm/mach-davinci/sram.c
arch/arm/mach-davinci/sram.c:75:8: warning: incorrect type in assignment (different address spaces)
arch/arm/mach-davinci/sram.c:75:8: expected void *addr
arch/arm/mach-davinci/sram.c:75:8: got void [noderef] <asn:2>*
arch/arm/mach-davinci/sram.c:81:12: warning: incorrect type in argument 1 (different address spaces)
arch/arm/mach-davinci/sram.c:81:12: expected void volatile [noderef] <asn:2>*addr
arch/arm/mach-davinci/sram.c:81:12: got void *addr

---
 arch/arm/mach-davinci/sram.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-davinci/sram.c +2 -2
index c5f7ee5..f18928b 100644
@@ -62,7 +62,7 @@ static int __init sram_init(void)
 	phys_addr_t phys = davinci_soc_info.sram_dma;
 	unsigned len = davinci_soc_info.sram_len;
 	int status = 0;
-	void *addr;
+	void __iomem *addr;
 
 	if (len) {
 		len = min_t(unsigned, len, SRAM_SIZE);
@@ -75,7 +75,7 @@ static int __init sram_init(void)
 		addr = ioremap(phys, len);
 		if (!addr)
 			return -ENOMEM;
-		status = gen_pool_add_virt(sram_pool, (unsigned)addr,
+		status = gen_pool_add_virt(sram_pool, (unsigned long) addr,
 					   phys, len, -1);
 		if (status < 0)
 			iounmap(addr);
Signature · 1 line
1.7.10.1
#4 lore raw

PATCH 4/4 ARM: davinci: ensure global variables are declared

In reply to Sekhar Nori

Fix the following sparse warnings by declaring relevant global variables.

CHECK arch/arm/mach-davinci/usb.c
arch/arm/mach-davinci/usb.c:134:12: warning: symbol 'da8xx_register_usb20' was not declared. Should it be static? arch/arm/mach-davinci/usb.c:169:12: warning: symbol 'da8xx_register_usb11' was not declared. Should it be static?

CHECK arch/arm/mach-davinci/pm.c
arch/arm/mach-davinci/pm.c:155:12: warning: symbol 'davinci_pm_init' was not declared. Should it be static?

---
 arch/arm/mach-davinci/pm.c  |    1 +
 arch/arm/mach-davinci/usb.c |    1 +
 2 files changed, 2 insertions(+)
arch/arm/mach-davinci/pm.c +1 -0
index eb8360b..a508fe5 100644
@@ -19,6 +19,7 @@
 #include <asm/delay.h>
 #include <asm/io.h>
 
+#include <mach/common.h>
 #include <mach/da8xx.h>
 #include <mach/sram.h>
 #include <mach/pm.h>
arch/arm/mach-davinci/usb.c +1 -0
index 34509ff..2b4c648 100644
@@ -10,6 +10,7 @@
 #include <mach/common.h>
 #include <mach/irqs.h>
 #include <mach/cputype.h>
+#include <mach/da8xx.h>
 #include <linux/platform_data/usb-davinci.h>
 
 #define DAVINCI_USB_OTG_BASE	0x01c64000
Signature · 1 line
1.7.10.1
#5 lore raw

cover ARM: davinci: sparse warning fixes

In reply to Sekhar Nori
Quoted 4 lines · Sekhar Nori

This patch series fixes some sparse errors/warnings occurring in arch/arm/mach-davinci/*

Tested on DA850 EVM (boot and suspend-to-RAM test).

Queuing these for v3.10.

Thanks,
Sekhar