linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: fix compilation warning during compilation
@ 2010-11-06  9:06 Marco Stornelli
  2010-11-08  9:13 ` Uwe Kleine-König
  0 siblings, 1 reply; 5+ messages in thread
From: Marco Stornelli @ 2010-11-06  9:06 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Tony Lindgren, Russell King, linux-omap, linux-arm-kernel

From: Marco Stornelli <marco.stornelli@gmail.com>

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

Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
---

--- linux-2.6.36-orig/arch/arm/plat-omap/include/plat/usb.h	2010-10-20 22:30:22.000000000 +0200
+++ linux-2.6.36/arch/arm/plat-omap/include/plat/usb.h	2010-11-01 09:44:13.000000000 +0100
@@ -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
--- linux-2.6.36-orig/arch/arm/mach-omap2/mux.c	2010-10-20 22:30:22.000000000 +0200
+++ linux-2.6.36/arch/arm/mach-omap2/mux.c	2010-11-01 10:21:29.000000000 +0100
@@ -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;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm: fix compilation warning during compilation
  2010-11-06  9:06 [PATCH] arm: fix compilation warning during compilation Marco Stornelli
@ 2010-11-08  9:13 ` Uwe Kleine-König
  2010-11-08 11:59   ` Marco Stornelli
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2010-11-08  9:13 UTC (permalink / raw)
  To: Marco Stornelli
  Cc: Linux Kernel, Tony Lindgren, linux-omap, Russell King,
	linux-arm-kernel, Sanjeev Premi

Hello,

On Sat, Nov 06, 2010 at 10:06:35AM +0100, Marco Stornelli wrote:
> From: Marco Stornelli <marco.stornelli@gmail.com>
> 
> 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.

> 
> Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
> ---
> 
> --- linux-2.6.36-orig/arch/arm/plat-omap/include/plat/usb.h	2010-10-20 22:30:22.000000000 +0200
> +++ linux-2.6.36/arch/arm/plat-omap/include/plat/usb.h	2010-11-01 09:44:13.000000000 +0100
> @@ -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
> --- linux-2.6.36-orig/arch/arm/mach-omap2/mux.c	2010-10-20 22:30:22.000000000 +0200
> +++ linux-2.6.36/arch/arm/mach-omap2/mux.c	2010-11-01 10:21:29.000000000 +0100
> @@ -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

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm: fix compilation warning during compilation
  2010-11-08  9:13 ` Uwe Kleine-König
@ 2010-11-08 11:59   ` Marco Stornelli
  2010-11-08 18:16     ` Gadiyar, Anand
  0 siblings, 1 reply; 5+ messages in thread
From: Marco Stornelli @ 2010-11-08 11:59 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Linux Kernel, Tony Lindgren, linux-omap, Russell King,
	linux-arm-kernel, Sanjeev Premi

2010/11/8 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:
> Hello,
>
> On Sat, Nov 06, 2010 at 10:06:35AM +0100, Marco Stornelli wrote:
>> From: Marco Stornelli <marco.stornelli@gmail.com>
>>
>> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm: fix compilation warning during compilation
  2010-11-08 11:59   ` Marco Stornelli
@ 2010-11-08 18:16     ` Gadiyar, Anand
  2010-11-09  8:07       ` Marco Stornelli
  0 siblings, 1 reply; 5+ messages in thread
From: Gadiyar, Anand @ 2010-11-08 18:16 UTC (permalink / raw)
  To: Marco Stornelli
  Cc: Uwe Kleine-König, Linux Kernel, Tony Lindgren, linux-omap,
	Russell King, linux-arm-kernel, Sanjeev Premi

2010/11/8 Marco Stornelli <marco.stornelli@gmail.com>:
> 2010/11/8 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:
>> Hello,
>>
>> On Sat, Nov 06, 2010 at 10:06:35AM +0100, Marco Stornelli wrote:
>>> From: Marco Stornelli <marco.stornelli@gmail.com>
>>>
>>> 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.
>

Marco,

Both of these are fixed in 2.6.37-rc1.

Commits afc28bc0ec and ca828760f9 respectively.

- Anand

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] arm: fix compilation warning during compilation
  2010-11-08 18:16     ` Gadiyar, Anand
@ 2010-11-09  8:07       ` Marco Stornelli
  0 siblings, 0 replies; 5+ messages in thread
From: Marco Stornelli @ 2010-11-09  8:07 UTC (permalink / raw)
  To: Gadiyar, Anand
  Cc: Uwe Kleine-König, Linux Kernel, Tony Lindgren, linux-omap,
	Russell King, linux-arm-kernel, Sanjeev Premi

2010/11/8 Gadiyar, Anand <gadiyar@ti.com>:
> 2010/11/8 Marco Stornelli <marco.stornelli@gmail.com>:
>> 2010/11/8 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:
>>> Hello,
>>>
>>> On Sat, Nov 06, 2010 at 10:06:35AM +0100, Marco Stornelli wrote:
>>>> From: Marco Stornelli <marco.stornelli@gmail.com>
>>>>
>>>> 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.
>>
>
> Marco,
>
> Both of these are fixed in 2.6.37-rc1.
>
> Commits afc28bc0ec and ca828760f9 respectively.
>
> - Anand
>

Very good. Thanks.

Marco

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-09  8:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-06  9:06 [PATCH] arm: fix compilation warning during compilation Marco Stornelli
2010-11-08  9:13 ` Uwe Kleine-König
2010-11-08 11:59   ` Marco Stornelli
2010-11-08 18:16     ` Gadiyar, Anand
2010-11-09  8:07       ` Marco Stornelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).