public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: i2c-mxs: Fix build warning
@ 2012-04-05 20:09 Fabio Estevam
       [not found] ` <1333656595-3600-1-git-send-email-festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2012-04-05 20:09 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: w.sang-bIcnvbaLZ9MEGnE8C9+IrQ, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	khali-PUYAD+kWke1g9hUCZPvPmw, Fabio Estevam

Fix the following build warning:

drivers/i2c/busses/i2c-mxs.c:207:8: warning: 'data' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Fabio Estevam <fabio.estevam-KZfg59tc24xl57MIdRCFDg@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 3d471d5..6a24a86 100644
--- a/drivers/i2c/busses/i2c-mxs.c
+++ b/drivers/i2c/busses/i2c-mxs.c
@@ -194,7 +194,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++) {
-- 
1.7.1

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

* Re: [PATCH] i2c: i2c-mxs: Fix build warning
       [not found] ` <1333656595-3600-1-git-send-email-festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2012-04-05 20:16   ` Wolfram Sang
       [not found]     ` <20120405201651.GA26902-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2012-04-05 20:16 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	ben-linux-elnMNo+KYs3YtjvyW6yDsg, khali-PUYAD+kWke1g9hUCZPvPmw,
	Fabio Estevam

[-- Attachment #1: Type: text/plain, Size: 506 bytes --]

On Thu, Apr 05, 2012 at 05:09:55PM -0300, Fabio Estevam wrote:
> Fix the following build warning:
> 
> drivers/i2c/busses/i2c-mxs.c:207:8: warning: 'data' may be used uninitialized in this function [-Wuninitialized]
> 
> Signed-off-by: Fabio Estevam <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

Do you agree with the compiler?

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] i2c: i2c-mxs: Fix build warning
       [not found]     ` <20120405201651.GA26902-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2012-04-05 20:36       ` Fabio Estevam
  0 siblings, 0 replies; 3+ messages in thread
From: Fabio Estevam @ 2012-04-05 20:36 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	ben-linux-elnMNo+KYs3YtjvyW6yDsg, khali-PUYAD+kWke1g9hUCZPvPmw,
	Fabio Estevam

On Thu, Apr 5, 2012 at 5:16 PM, Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
> On Thu, Apr 05, 2012 at 05:09:55PM -0300, Fabio Estevam wrote:
>> Fix the following build warning:
>>
>> drivers/i2c/busses/i2c-mxs.c:207:8: warning: 'data' may be used uninitialized in this function [-Wuninitialized]
>>
>> Signed-off-by: Fabio Estevam <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
>
> Do you agree with the compiler?

After looking at it carefully I conclude that is not possible for
'data' to be used uninitialized.

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

end of thread, other threads:[~2012-04-05 20:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-05 20:09 [PATCH] i2c: i2c-mxs: Fix build warning Fabio Estevam
     [not found] ` <1333656595-3600-1-git-send-email-festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-04-05 20:16   ` Wolfram Sang
     [not found]     ` <20120405201651.GA26902-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-04-05 20:36       ` Fabio Estevam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox