Patchwork [U-Boot,v2,09/12] drivers/i2c/davinci_i2c.c: Fix GCC 4.6 warning

login
register
mail settings
Submitter Anatolij Gustschin
Date Nov. 19, 2011, 12:51 p.m.
Message ID <1321707098-14428-1-git-send-email-agust@denx.de>
Download mbox | patch
Permalink /patch/126583/
State Accepted
Commit bd0f5ca806c73f9e1ef4a2a0416233ab7e257df9
Delegated to: Heiko Schocher
Headers show

Comments

Anatolij Gustschin - Nov. 19, 2011, 12:51 p.m.
Fix:
davinci_i2c.c: In function 'flush_rx':
davinci_i2c.c:81:6: warning: variable 'dummy' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
---
v2:
 - drop void cast since REG() is not a function call but
   expands to (*(volatile unsigned int *)(I2C_DDR))
   and thus we don't need to indicate that return value is ignored
   intentionally

 drivers/i2c/davinci_i2c.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
Anatolij Gustschin - Nov. 23, 2011, 8:12 a.m.
Hello Heiko,

On Sat, 19 Nov 2011 13:51:38 +0100
Anatolij Gustschin <agust@denx.de> wrote:

> Fix:
> davinci_i2c.c: In function 'flush_rx':
> davinci_i2c.c:81:6: warning: variable 'dummy' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> Acked-by: Heiko Schocher <hs@denx.de>
> ---
> v2:
>  - drop void cast since REG() is not a function call but
>    expands to (*(volatile unsigned int *)(I2C_DDR))
>    and thus we don't need to indicate that return value is ignored
>    intentionally
> 
>  drivers/i2c/davinci_i2c.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)

Could you apply this patch, too? Thanks!

Anatolij
Heiko Schocher - Nov. 23, 2011, 8:28 a.m.
Hello Anatolij,

Anatolij Gustschin wrote:
> Hello Heiko,
> 
> On Sat, 19 Nov 2011 13:51:38 +0100
> Anatolij Gustschin <agust@denx.de> wrote:
> 
>> Fix:
>> davinci_i2c.c: In function 'flush_rx':
>> davinci_i2c.c:81:6: warning: variable 'dummy' set but not used
>> [-Wunused-but-set-variable]
>>
>> Signed-off-by: Anatolij Gustschin <agust@denx.de>
>> Acked-by: Heiko Schocher <hs@denx.de>
>> ---
>> v2:
>>  - drop void cast since REG() is not a function call but
>>    expands to (*(volatile unsigned int *)(I2C_DDR))
>>    and thus we don't need to indicate that return value is ignored
>>    intentionally
>>
>>  drivers/i2c/davinci_i2c.c |    4 +---
>>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> Could you apply this patch, too? Thanks!

Had this on my Todo list ;-) done.

Thanks!

bye,
Heiko

Patch

diff --git a/drivers/i2c/davinci_i2c.c b/drivers/i2c/davinci_i2c.c
index 5e3406d..a09dc76 100644
--- a/drivers/i2c/davinci_i2c.c
+++ b/drivers/i2c/davinci_i2c.c
@@ -78,13 +78,11 @@  static int poll_i2c_irq(int mask)
 
 void flush_rx(void)
 {
-	int	dummy;
-
 	while (1) {
 		if (!(REG(I2C_STAT) & I2C_STAT_RRDY))
 			break;
 
-		dummy = REG(I2C_DRR);
+		REG(I2C_DRR);
 		REG(I2C_STAT) = I2C_STAT_RRDY;
 		udelay(1000);
 	}