All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: "Wolfram Sang" <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	"Shawn Guo" <shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"Shawn Guo" <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"Ben Dooks" <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
	"Uwe Kleine-König"
	<u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Subject: Re: [PATCH] i2c-mxs: fix compile warning in mxs_i2c_xfer()
Date: Fri, 2 Dec 2011 20:42:02 +0100	[thread overview]
Message-ID: <201112022042.03160.marek.vasut@gmail.com> (raw)
In-Reply-To: <20111125090806.GA2535-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

> On Fri, Nov 25, 2011 at 09:15:20AM +0800, Shawn Guo wrote:
> > On Thu, Nov 24, 2011 at 09:37:47AM +0100, Wolfram Sang wrote:
> > > On Thu, Nov 24, 2011 at 09:29:03AM +0100, Uwe Kleine-König wrote:
> > > > Hello Shawn,
> > > > 
> > > > On Thu, Nov 24, 2011 at 03:52:20PM +0800, Shawn Guo wrote:
> > > > >   CC      drivers/i2c/busses/i2c-mxs.o
> > > > > 
> > > > > drivers/i2c/busses/i2c-mxs.c: In function ‘mxs_i2c_xfer’:
> > > > > drivers/i2c/busses/i2c-mxs.c:196:6: warning: ‘data’ may be used
> > > > > uninitialized in this function
> > > > > 
> > > > > Signed-off-by: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> > > > > ---
> > > > > 
> > > > >  drivers/i2c/busses/i2c-mxs.c |    2 +-
> > > > >  1 files changed, 1 insertions(+), 1 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/i2c/busses/i2c-mxs.c
> > > > > b/drivers/i2c/busses/i2c-mxs.c index 7e78f7c..00f098f 100644
> > > > > --- a/drivers/i2c/busses/i2c-mxs.c
> > > > > +++ b/drivers/i2c/busses/i2c-mxs.c
> > > > > @@ -193,7 +193,7 @@ static int mxs_i2c_wait_for_data(struct
> > > > > mxs_i2c_dev *i2c)
> > > > > 
> > > > >  static int mxs_i2c_finish_read(struct mxs_i2c_dev *i2c, u8 *buf,
> > > > >  int len) {
> > > > > 
> > > > > -	u32 data;
> > > > > +	u32 data = 0;
> > > > > 
> > > > >  	int i;
> > > > >  	
> > > > >  	for (i = 0; i < len; i++) {
> > > > 
> > > > Looks like a stupid compiler. Then better use
> > > > 
> > > > 	u32 uninitialized_var(data);
> > > 
> > > Leave it as it is and fix the compiler? Will do another test later to
> > > make sure.
> > 
> > Ben, do you have an opinion on this, leave it there or fix it?
> 
> Sorry, forgot the tests yesterday. I don't like random annotations
> because of faulty compilers. Please fix that one. NACK from me.

Hi,

I hit this with emdebian gcc 4.6.1 ... I'd be for merging this u32 data = 0; 
stuff, so on my side it's ACK.

M

WARNING: multiple messages have this Message-ID (diff)
From: marek.vasut@gmail.com (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] i2c-mxs: fix compile warning in mxs_i2c_xfer()
Date: Fri, 2 Dec 2011 20:42:02 +0100	[thread overview]
Message-ID: <201112022042.03160.marek.vasut@gmail.com> (raw)
In-Reply-To: <20111125090806.GA2535@pengutronix.de>

> On Fri, Nov 25, 2011 at 09:15:20AM +0800, Shawn Guo wrote:
> > On Thu, Nov 24, 2011 at 09:37:47AM +0100, Wolfram Sang wrote:
> > > On Thu, Nov 24, 2011 at 09:29:03AM +0100, Uwe Kleine-K?nig wrote:
> > > > Hello Shawn,
> > > > 
> > > > On Thu, Nov 24, 2011 at 03:52:20PM +0800, Shawn Guo wrote:
> > > > >   CC      drivers/i2c/busses/i2c-mxs.o
> > > > > 
> > > > > drivers/i2c/busses/i2c-mxs.c: In function ?mxs_i2c_xfer?:
> > > > > drivers/i2c/busses/i2c-mxs.c:196:6: warning: ?data? may be used
> > > > > uninitialized in this function
> > > > > 
> > > > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > > > > ---
> > > > > 
> > > > >  drivers/i2c/busses/i2c-mxs.c |    2 +-
> > > > >  1 files changed, 1 insertions(+), 1 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/i2c/busses/i2c-mxs.c
> > > > > b/drivers/i2c/busses/i2c-mxs.c index 7e78f7c..00f098f 100644
> > > > > --- a/drivers/i2c/busses/i2c-mxs.c
> > > > > +++ b/drivers/i2c/busses/i2c-mxs.c
> > > > > @@ -193,7 +193,7 @@ static int mxs_i2c_wait_for_data(struct
> > > > > mxs_i2c_dev *i2c)
> > > > > 
> > > > >  static int mxs_i2c_finish_read(struct mxs_i2c_dev *i2c, u8 *buf,
> > > > >  int len) {
> > > > > 
> > > > > -	u32 data;
> > > > > +	u32 data = 0;
> > > > > 
> > > > >  	int i;
> > > > >  	
> > > > >  	for (i = 0; i < len; i++) {
> > > > 
> > > > Looks like a stupid compiler. Then better use
> > > > 
> > > > 	u32 uninitialized_var(data);
> > > 
> > > Leave it as it is and fix the compiler? Will do another test later to
> > > make sure.
> > 
> > Ben, do you have an opinion on this, leave it there or fix it?
> 
> Sorry, forgot the tests yesterday. I don't like random annotations
> because of faulty compilers. Please fix that one. NACK from me.

Hi,

I hit this with emdebian gcc 4.6.1 ... I'd be for merging this u32 data = 0; 
stuff, so on my side it's ACK.

M

  parent reply	other threads:[~2011-12-02 19:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-24  7:52 [PATCH] i2c-mxs: fix compile warning in mxs_i2c_xfer() Shawn Guo
2011-11-24  7:52 ` Shawn Guo
     [not found] ` <1322121140-5216-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-11-24  8:00   ` Wolfram Sang
2011-11-24  8:00     ` Wolfram Sang
     [not found]     ` <20111124080004.GD8439-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-24  8:24       ` Shawn Guo
2011-11-24  8:24         ` Shawn Guo
2011-11-24  8:29   ` Uwe Kleine-König
2011-11-24  8:29     ` Uwe Kleine-König
     [not found]     ` <20111124082903.GV19986-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-24  8:37       ` Wolfram Sang
2011-11-24  8:37         ` Wolfram Sang
     [not found]         ` <20111124083747.GE8439-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-24  9:02           ` Dong Aisheng-B29396
2011-11-24  9:02             ` Dong Aisheng-B29396
     [not found]             ` <65EE16ACC360FA4D99C96DC085B3F77233A4E4-TcFNo7jSaXPiTqIcKZ1S2K4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
2011-11-24  9:06               ` Uwe Kleine-König
2011-11-24  9:06                 ` Uwe Kleine-König
     [not found]                 ` <20111124090653.GX19986-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-24  9:09                   ` Dong Aisheng-B29396
2011-11-24  9:09                     ` Dong Aisheng-B29396
2011-11-24  9:11             ` Lothar Waßmann
2011-11-24  9:11               ` Lothar Waßmann
2011-11-25  1:15           ` Shawn Guo
2011-11-25  1:15             ` Shawn Guo
     [not found]             ` <20111125011519.GA18403-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2011-11-25  9:08               ` Wolfram Sang
2011-11-25  9:08                 ` Wolfram Sang
     [not found]                 ` <20111125090806.GA2535-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-12-02 19:42                   ` Marek Vasut [this message]
2011-12-02 19:42                     ` Marek Vasut

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=201112022042.03160.marek.vasut@gmail.com \
    --to=marek.vasut-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    /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.