Skip to contentSkip to conversation

arm: fix compilation warning during compilation

PATCH In review Marco Stornelli 3 participants 5 messages Nov 6, 2010 – Nov 9, 2010

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

PATCH 1/1 arm: fix compilation warning during compilation

From: Marco Stornelli <[email protected]>

During compilation of 2.6.36 for Beagle board, there a are a couple of warnings. This patch fix them.

---

arch/arm/plat-omap/include/plat/usb.h +1 -1
@@ -105,7 +105,7 @@ static inline void omap1_usb_init(struct
 #if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_ARCH_OMAP_OTG_MODULE)
 void omap2_usbfs_init(struct omap_usb_config *pdata);
 #else
-static inline omap2_usbfs_init(struct omap_usb_config *pdata)
+static inline void omap2_usbfs_init(struct omap_usb_config *pdata)
 {
 }
 #endif
arch/arm/mach-omap2/mux.c +1 -1
@@ -87,7 +87,7 @@ static char *omap_mux_options;
 int __init omap_mux_init_gpio(int gpio, int val)
 {
 	struct omap_mux_entry *e;
-	struct omap_mux *gpio_mux;
+	struct omap_mux *gpio_mux = NULL;
 	u16 old_mode;
 	u16 mux_mode;
 	int found = 0;
#1 lore raw

Hello,

Quoted 3 lines · Marco Stornelli

From: Marco Stornelli <[email protected]>

During compilation of 2.6.36 for Beagle board, there a are a couple of warnings. This patch fix them.

Please break lines for commit logs at around 76 chars and mention the exact compiler warning being fixed.

Quoted 18 lines

---

arch/arm/plat-omap/include/plat/usb.h +1 -1
@@ -105,7 +105,7 @@ static inline void omap1_usb_init(struct
 #if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_ARCH_OMAP_OTG_MODULE)
 void omap2_usbfs_init(struct omap_usb_config *pdata);
 #else
-static inline omap2_usbfs_init(struct omap_usb_config *pdata)
+static inline void omap2_usbfs_init(struct omap_usb_config *pdata)
 {
 }
 #endif

arch/arm/mach-omap2/mux.c static char *omap_mux_options; · line 90

Quoted 5 lines
arch/arm/mach-omap2/mux.c +1 -1
@@ -87,7 +87,7 @@ static char *omap_mux_options;
 int __init omap_mux_init_gpio(int gpio, int val)
 {
 	struct omap_mux_entry *e;
-	struct omap_mux *gpio_mux;
+	struct omap_mux *gpio_mux = NULL;

this warning is already fixed by ca82876 (omap2: fix assorted compiler warnings).

As this warning is a false positive (i.e. gpio_mux is never used uninitialized), making the line read

	struct omap_mux *uninitialized_var(gpio_mux);

(IMHO) would have been a bit better for both, readabily and (probably) generated code.

Thanks
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#2 lore raw

2010/11/8 Uwe Kleine-K?nig <[email protected]>:

Quoted 9 lines

Hello,

Quoted 3 lines · Marco Stornelli

From: Marco Stornelli <[email protected]>

During compilation of 2.6.36 for Beagle board, there a are a couple of warnings. This patch fix them.

Please break lines for commit logs at around 76 chars and mention the exact compiler warning being fixed.

My compiler version is gcc 4.4.1. Two warning: variable gpio_mux may be used not initialized (false positive, I agree); second: compiler fix the void lack in the inline function with an int. Obviously there is a lack of return type that it must be void.

Regards,

Marco

#3 lore raw

2010/11/8 Marco Stornelli <[email protected]>:

Quoted 7 lines

2010/11/8 Uwe Kleine-K?nig <[email protected]>:

Quoted 6 lines

Hello,

Quoted 3 lines · Marco Stornelli

From: Marco Stornelli <[email protected]>

During compilation of 2.6.36 for Beagle board, there a are a couple of warnings. This patch fix them.

Quoted 9 lines
Quoted 3 lines

Please break lines for commit logs at around 76 chars and mention the exact compiler warning being fixed.

My compiler version is gcc 4.4.1. Two warning: variable gpio_mux may be used not initialized (false positive, I agree); second: compiler fix the void lack in the inline function with an int. Obviously there is a lack of return type that it must be void.

Marco,

Both of these are fixed in 2.6.37-rc1.

Commits afc28bc0ec and ca828760f9 respectively.

- Anand

#4 lore raw

2010/11/8 Gadiyar, Anand <[email protected]>:

Quoted 18 lines

2010/11/8 Marco Stornelli <[email protected]>:

Quoted 7 lines

2010/11/8 Uwe Kleine-K?nig <[email protected]>:

Quoted 6 lines

Hello,

Quoted 3 lines · Marco Stornelli

From: Marco Stornelli <[email protected]>

During compilation of 2.6.36 for Beagle board, there a are a couple of warnings. This patch fix them.

Quoted 9 lines
Quoted 3 lines

Please break lines for commit logs at around 76 chars and mention the exact compiler warning being fixed.

My compiler version is gcc 4.4.1. Two warning: variable gpio_mux may be used not initialized (false positive, I agree); second: compiler fix the void lack in the inline function with an int. Obviously there is a lack of return type that it must be void.

Quoted 8 lines

Marco,

Both of these are fixed in 2.6.37-rc1.

Commits afc28bc0ec and ca828760f9 respectively.

- Anand

Very good. Thanks.

Marco