From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Marco Stornelli <marco.stornelli@gmail.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
Tony Lindgren <tony@atomide.com>,
linux-omap@vger.kernel.org, Russell King <linux@arm.linux.org.uk>,
linux-arm-kernel@lists.infradead.org,
Sanjeev Premi <premi@ti.com>
Subject: Re: [PATCH] arm: fix compilation warning during compilation
Date: Mon, 8 Nov 2010 10:13:02 +0100 [thread overview]
Message-ID: <20101108091302.GO16938@pengutronix.de> (raw)
In-Reply-To: <4CD51A9B.7010806@gmail.com>
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/ |
WARNING: multiple messages have this Message-ID (diff)
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: fix compilation warning during compilation
Date: Mon, 8 Nov 2010 10:13:02 +0100 [thread overview]
Message-ID: <20101108091302.GO16938@pengutronix.de> (raw)
In-Reply-To: <4CD51A9B.7010806@gmail.com>
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/ |
next prev parent reply other threads:[~2010-11-08 9:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-06 9:06 [PATCH] arm: fix compilation warning during compilation Marco Stornelli
2010-11-06 9:06 ` Marco Stornelli
2010-11-08 9:13 ` Uwe Kleine-König [this message]
2010-11-08 9:13 ` Uwe Kleine-König
2010-11-08 11:59 ` Marco Stornelli
2010-11-08 11:59 ` Marco Stornelli
2010-11-08 18:16 ` Gadiyar, Anand
2010-11-08 18:16 ` Gadiyar, Anand
2010-11-08 18:16 ` Gadiyar, Anand
2010-11-09 8:07 ` Marco Stornelli
2010-11-09 8:07 ` Marco Stornelli
2010-11-09 8:07 ` Marco Stornelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101108091302.GO16938@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=marco.stornelli@gmail.com \
--cc=premi@ti.com \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.