Skip to contentSkip to conversation

OMAP2+: trivial sparse fixes

PATCH New Nishanth Menon 3 participants 8 messages Jan 4, 2011 – Jan 6, 2011

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

cover OMAP2+: trivial sparse fixes

Source: git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
branch: omap-for-linus (dc69d1a omap2: Make OMAP2PLUS select OMAP_DM_TIMER)

Building for sparse warnings result in the following warnings:
http://pastebin.mozilla.org/907954

This is series 2 of the sparse fixes
(series 1:
http://marc.info/?t=129408118000003&r=1&w=2
and
http://marc.info/?t=129408352700002&r=1&w=2)

Nishanth Menon (5):
omap3|4: mux: make local structures static
omap3: zoom: use static for pointer passing
omap3: igep3: make igep3_flash_init static omap2+: wdt: trivial sparse fixes
omap2+: pm_bus: make functions used as pointers as static

 arch/arm/mach-omap2/board-igep0030.c         |    4 ++--
 arch/arm/mach-omap2/board-zoom-peripherals.c |    4 ++--
 arch/arm/mach-omap2/devices.c                |    2 +-
 arch/arm/mach-omap2/mux34xx.c                |    4 ++--
 arch/arm/mach-omap2/mux44xx.c                |    6 +++---
 arch/arm/mach-omap2/pm_bus.c                 |    4 ++--
 arch/arm/mach-omap2/wd_timer.c               |    2 ++
 7 files changed, 14 insertions(+), 12 deletions(-)

---
Regards,
Nishanth Menon

#1 lore raw

PATCH 1/5 omap3|4: mux: make local structures static

Mux data is passed by pointers to mux.c from the SoC specific mux file, these variables dont really need to be global scope.

This fixes the following sparse warnings:
arch/arm/mach-omap2/mux44xx.c:547:29: warning: symbol 'omap4_core_cbl_ball' was not declared. Should it be static? arch/arm/mach-omap2/mux44xx.c:1265:29: warning: symbol 'omap4_core_cbs_ball' was not declared. Should it be static? arch/arm/mach-omap2/mux44xx.c:1549:29: warning: symbol 'omap4_wkup_cbl_cbs_ball' was not declared. Should it be static?

---
 arch/arm/mach-omap2/mux34xx.c |    4 ++--
 arch/arm/mach-omap2/mux44xx.c |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/mux34xx.c +2 -2
index 440c98e..17f80e4 100644
@@ -703,7 +703,7 @@ static struct omap_mux __initdata omap3_muxmodes[] = {
  * Signals different on CBC package compared to the superset
  */
 #if defined(CONFIG_OMAP_MUX) && defined(CONFIG_OMAP_PACKAGE_CBC)
-struct omap_mux __initdata omap3_cbc_subset[] = {
+static struct omap_mux __initdata omap3_cbc_subset[] = {
 	{ .reg_offset = OMAP_MUX_TERMINATOR },
 };
 #else
@@ -721,7 +721,7 @@ struct omap_mux __initdata omap3_cbc_subset[] = {
  */
 #if defined(CONFIG_OMAP_MUX) && defined(CONFIG_DEBUG_FS)	\
 		&& defined(CONFIG_OMAP_PACKAGE_CBC)
-struct omap_ball __initdata omap3_cbc_ball[] = {
+static struct omap_ball __initdata omap3_cbc_ball[] = {
 	_OMAP3_BALLENTRY(CAM_D0, "ae16", NULL),
 	_OMAP3_BALLENTRY(CAM_D1, "ae15", NULL),
 	_OMAP3_BALLENTRY(CAM_D10, "d25", NULL),
arch/arm/mach-omap2/mux44xx.c +3 -3
index 980f11d..c322e7b 100644
@@ -544,7 +544,7 @@ static struct omap_mux __initdata omap4_core_muxmodes[] = {
  */
 #if defined(CONFIG_OMAP_MUX) && defined(CONFIG_DEBUG_FS)		\
 		&& defined(CONFIG_OMAP_PACKAGE_CBL)
-struct omap_ball __initdata omap4_core_cbl_ball[] = {
+static struct omap_ball __initdata omap4_core_cbl_ball[] = {
 	_OMAP4_BALLENTRY(GPMC_AD0, "c12", NULL),
 	_OMAP4_BALLENTRY(GPMC_AD1, "d12", NULL),
 	_OMAP4_BALLENTRY(GPMC_AD2, "c13", NULL),
@@ -1262,7 +1262,7 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = {
  */
 #if defined(CONFIG_OMAP_MUX) && defined(CONFIG_DEBUG_FS)		\
 		&& defined(CONFIG_OMAP_PACKAGE_CBS)
-struct omap_ball __initdata omap4_core_cbs_ball[] = {
+static struct omap_ball __initdata omap4_core_cbs_ball[] = {
 	_OMAP4_BALLENTRY(GPMC_AD0, "c12", NULL),
 	_OMAP4_BALLENTRY(GPMC_AD1, "d12", NULL),
 	_OMAP4_BALLENTRY(GPMC_AD2, "c13", NULL),
@@ -1546,7 +1546,7 @@ static struct omap_mux __initdata omap4_wkup_muxmodes[] = {
  */
 #if defined(CONFIG_OMAP_MUX) && defined(CONFIG_DEBUG_FS)		\
 		&& defined(CONFIG_OMAP_PACKAGE_CBL)
-struct omap_ball __initdata omap4_wkup_cbl_cbs_ball[] = {
+static struct omap_ball __initdata omap4_wkup_cbl_cbs_ball[] = {
 	_OMAP4_BALLENTRY(SIM_IO, "h4", NULL),
 	_OMAP4_BALLENTRY(SIM_CLK, "j2", NULL),
 	_OMAP4_BALLENTRY(SIM_RESET, "g2", NULL),
Signature · 1 line
1.6.3.3
#2 lore raw

PATCH 2/5 omap3: zoom: use static for pointer passing

In reply to Nishanth Menon

omap_zoom_wlan_data and zoom2_set_hs_extmute are not used beyond the scope of zoom-peripherals directly, instead pointers are used. make them static instead.

Fixes sparse warnings:
arch/arm/mach-omap2/board-zoom-peripherals.c:193:29: warning: symbol 'omap_zoom_wlan_data' was not declared. Should it be static? arch/arm/mach-omap2/board-zoom-peripherals.c:245:6: warning: symbol 'zoom2_set_hs_extmute' was not declared. Should it be static?

---
 arch/arm/mach-omap2/board-zoom-peripherals.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/board-zoom-peripherals.c +2 -2
index 3fbd0ed..3d1f9ab 100644
@@ -190,7 +190,7 @@ static struct platform_device omap_vwlan_device = {
 	},
 };
 
-struct wl12xx_platform_data omap_zoom_wlan_data __initdata = {
+static struct wl12xx_platform_data omap_zoom_wlan_data __initdata = {
 	.irq = OMAP_GPIO_IRQ(OMAP_ZOOM_WLAN_IRQ_GPIO),
 	/* ZOOM ref clock is 26 MHz */
 	.board_ref_clock = 1,
@@ -242,7 +242,7 @@ static int zoom_twl_gpio_setup(struct device *dev,
 }
 
 /* EXTMUTE callback function */
-void zoom2_set_hs_extmute(int mute)
+static void zoom2_set_hs_extmute(int mute)
 {
 	gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute);
 }
Signature · 1 line
1.6.3.3
#3 lore raw

PATCH 3/5 omap3: igep3: make igep3_flash_init static

In reply to Nishanth Menon

igep3_flash_init is not used beyond the scope of the file, make it static instead.

Fixes sparse warning:
arch/arm/mach-omap2/board-igep0030.c:106:13: warning: symbol 'igep3_flash_init' was not declared. Should it be static?

---
 arch/arm/mach-omap2/board-igep0030.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/board-igep0030.c +2 -2
index bcccd68..c88e8f7 100644
@@ -103,7 +103,7 @@ static struct platform_device igep3_onenand_device = {
 	},
 };
 
-void __init igep3_flash_init(void)
+static void __init igep3_flash_init(void)
 {
 	u8 cs = 0;
 	u8 onenandcs = GPMC_CS_NUM + 1;
@@ -137,7 +137,7 @@ void __init igep3_flash_init(void)
 }
 
 #else
-void __init igep3_flash_init(void) {}
+static void __init igep3_flash_init(void) {}
 #endif
 
 static struct regulator_consumer_supply igep3_vmmc1_supply = {
Signature · 1 line
1.6.3.3
#4 lore raw

PATCH 4/5 omap2+: wdt: trivial sparse fixes

In reply to Nishanth Menon

omap2_wd_timer_disable is declared in wdtimer.h and used by hwmod function pointers for usage, the header inclusion is necessary to ensure that the prototype and function remains consistent. omap_wdt_latency is passed as a pointer and does not need global scope

Fixes sparse warnings:
arch/arm/mach-omap2/devices.c:981:31: warning: symbol 'omap_wdt_latency' was not declared. Should it be static? arch/arm/mach-omap2/wd_timer.c:27:5: warning: symbol 'omap2_wd_timer_disable' was not declared. Should it be static?

---
 arch/arm/mach-omap2/devices.c  |    2 +-
 arch/arm/mach-omap2/wd_timer.c |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/devices.c +1 -1
index 381f4eb..2c9c912 100644
@@ -978,7 +978,7 @@ static int __init omap2_init_devices(void)
 arch_initcall(omap2_init_devices);
 
 #if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
-struct omap_device_pm_latency omap_wdt_latency[] = {
+static struct omap_device_pm_latency omap_wdt_latency[] = {
 	[0] = {
 		.deactivate_func = omap_device_idle_hwmods,
 		.activate_func   = omap_device_enable_hwmods,
arch/arm/mach-omap2/wd_timer.c +2 -0
index b0c4907..4067669 100644
@@ -13,6 +13,8 @@
 
 #include <plat/omap_hwmod.h>
 
+#include "wd_timer.h"
+
 /*
  * In order to avoid any assumptions from bootloader regarding WDT
  * settings, WDT module is reset during init. This enables the watchdog
Signature · 1 line
1.6.3.3
#5 lore raw

PATCH 5/5 omap2+: pm_bus: make functions used as pointers as static

In reply to Nishanth Menon

omap_pm_runtime_suspend and omap_pm_runtime_resume are used as function pointers and does not really need to be exposed to the world.

Fixes sparse warnings:
arch/arm/mach-omap2/pm_bus.c:23:5: warning: symbol 'omap_pm_runtime_suspend' was not declared. Should it be static? arch/arm/mach-omap2/pm_bus.c:40:5: warning: symbol 'omap_pm_runtime_resume' was not declared. Should it be static?

---
 arch/arm/mach-omap2/pm_bus.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/pm_bus.c +2 -2
index 784989f..5acd2ab 100644
@@ -20,7 +20,7 @@
 #include <plat/omap-pm.h>
 
 #ifdef CONFIG_PM_RUNTIME
-int omap_pm_runtime_suspend(struct device *dev)
+static int omap_pm_runtime_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	int r, ret = 0;
@@ -37,7 +37,7 @@ int omap_pm_runtime_suspend(struct device *dev)
 	return ret;
 };
 
-int omap_pm_runtime_resume(struct device *dev)
+static int omap_pm_runtime_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	int r;
Signature · 1 line
1.6.3.3
#6 lore raw

PATCH 5/5 omap2+: pm_bus: make functions used as pointers as static

Quoted 9 lines · Nishanth Menon

omap_pm_runtime_suspend and omap_pm_runtime_resume are used as function pointers and does not really need to be exposed to the world.

Fixes sparse warnings:
arch/arm/mach-omap2/pm_bus.c:23:5: warning: symbol 'omap_pm_runtime_suspend' was not declared. Should it be static? arch/arm/mach-omap2/pm_bus.c:40:5: warning: symbol 'omap_pm_runtime_resume' was not declared. Should it be static?

Thanks, will queue this one in my pm-fixes branch for 2.6.38-rc.

Kevin

Quoted 26 lines
---
 arch/arm/mach-omap2/pm_bus.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/pm_bus.c +2 -2
index 784989f..5acd2ab 100644
@@ -20,7 +20,7 @@
 #include <plat/omap-pm.h>
 
 #ifdef CONFIG_PM_RUNTIME
-int omap_pm_runtime_suspend(struct device *dev)
+static int omap_pm_runtime_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	int r, ret = 0;
@@ -37,7 +37,7 @@ int omap_pm_runtime_suspend(struct device *dev)
 	return ret;
 };
 
-int omap_pm_runtime_resume(struct device *dev)
+static int omap_pm_runtime_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	int r;
maintainer
#7 lore raw

PATCH 5/5 omap2+: pm_bus: make functions used as pointers as static

Quoted 6 lines · Kevin Hilman
Quoted 4 lines · Nishanth Menon

omap_pm_runtime_suspend and omap_pm_runtime_resume are used as function pointers and does not really need to be exposed to the world.

Quoted 7 lines
Quoted 5 lines

Fixes sparse warnings:
arch/arm/mach-omap2/pm_bus.c:23:5: warning: symbol 'omap_pm_runtime_suspend' was not declared. Should it be static? arch/arm/mach-omap2/pm_bus.c:40:5: warning: symbol 'omap_pm_runtime_resume' was not declared. Should it be static?

Thanks, will queue this one in my pm-fixes branch for 2.6.38-rc.

I'll take patches 1 - 4.

Tony