[U-Boot-Users] [PATCH] fsl_i2c: Fix used uninitialized variable

fsl_i2c.c: In function 'set_i2c_bus_speed': fsl_i2c.c:120: warning: 'dfsr' may be used uninitialized in this function fsl_i2c.c:120: warning: 'fdr' may be used uninitialized in this function
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c index dde0571..917a4ba 100644 --- a/drivers/i2c/fsl_i2c.c +++ b/drivers/i2c/fsl_i2c.c @@ -117,7 +117,8 @@ static unsigned int set_i2c_bus_speed(const struct fsl_i2c *dev, { unsigned short divider = min(i2c_clk / speed, (unsigned short) -1); unsigned int i; - u8 fdr, dfsr; + u8 fdr = 0x3F; + u8 dfsr = 0x3F;
/* * We want to choose an FDR/DFSR that generates an I2C bus speed that

On Apr 1, 2008, at 3:34 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
fsl_i2c.c: In function 'set_i2c_bus_speed': fsl_i2c.c:120: warning: 'dfsr' may be used uninitialized in this function fsl_i2c.c:120: warning: 'fdr' may be used uninitialized in this function
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c index dde0571..917a4ba 100644 --- a/drivers/i2c/fsl_i2c.c +++ b/drivers/i2c/fsl_i2c.c @@ -117,7 +117,8 @@ static unsigned int set_i2c_bus_speed(const struct fsl_i2c *dev, { unsigned short divider = min(i2c_clk / speed, (unsigned short) -1); unsigned int i;
- u8 fdr, dfsr;
u8 fdr = 0x3F;
u8 dfsr = 0x3F;
/*
- We want to choose an FDR/DFSR that generates an I2C bus speed that
-- 1.5.4.5
I posted a patch that moved fdr, dfsr inside the loop to fix the warnings.
- k

On 15:56 Tue 01 Apr , Kumar Gala wrote:
On Apr 1, 2008, at 3:34 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
fsl_i2c.c: In function 'set_i2c_bus_speed': fsl_i2c.c:120: warning: 'dfsr' may be used uninitialized in this function fsl_i2c.c:120: warning: 'fdr' may be used uninitialized in this function
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c index dde0571..917a4ba 100644 --- a/drivers/i2c/fsl_i2c.c +++ b/drivers/i2c/fsl_i2c.c @@ -117,7 +117,8 @@ static unsigned int set_i2c_bus_speed(const struct fsl_i2c *dev, { unsigned short divider = min(i2c_clk / speed, (unsigned short) -1); unsigned int i;
- u8 fdr, dfsr;
u8 fdr = 0x3F;
u8 dfsr = 0x3F;
/*
- We want to choose an FDR/DFSR that generates an I2C bus speed that
-- 1.5.4.5
I posted a patch that moved fdr, dfsr inside the loop to fix the warnings.
Not Found could you give the subject please
Best Regards, J.

In message 20080401212630.GA26810@game.jcrosoft.org you wrote:
I posted a patch that moved fdr, dfsr inside the loop to fix the warnings.
Not Found could you give the subject please
7607 03/26 Kumar Gala [U-Boot-Users] [PATCH] Fix warnings introduced by I2C bus speed setti
It's on my todo list.
Best regards,
Wolfgang Denk
participants (3)
-
Jean-Christophe PLAGNIOL-VILLARD
-
Kumar Gala
-
Wolfgang Denk