Patchwork [U-Boot,54/56] mpc8220/i2c.c: Fix GCC 4.6 build warning

login
register
mail settings
Submitter Wolfgang Denk
Date Nov. 5, 2011, 1:55 a.m.
Message ID <1320458160-23136-55-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/123779/
State Accepted
Commit 8b337be04ec237d062ff2fab929ceea32fa3da83
Headers show

Comments

Wolfgang Denk - Nov. 5, 2011, 1:55 a.m.
Fix:
i2c.c: In function 'wait_for_bb':
i2c.c:109:16: warning: variable 'temp' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Heiko Schocher <hs@denx.de>
---
 arch/powerpc/cpu/mpc8220/i2c.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
Wolfgang Denk - Nov. 7, 2011, 9:17 p.m.
Dear Wolfgang Denk,

In message <1320458160-23136-55-git-send-email-wd@denx.de> you wrote:
> Fix:
> i2c.c: In function 'wait_for_bb':
> i2c.c:109:16: warning: variable 'temp' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Heiko Schocher <hs@denx.de>
> ---
>  arch/powerpc/cpu/mpc8220/i2c.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/arch/powerpc/cpu/mpc8220/i2c.c b/arch/powerpc/cpu/mpc8220/i2c.c
index 76ecdf1..2f35d20 100644
--- a/arch/powerpc/cpu/mpc8220/i2c.c
+++ b/arch/powerpc/cpu/mpc8220/i2c.c
@@ -105,15 +105,13 @@  static int wait_for_bb (void)
 	status = mpc_reg_in (&regs->sr);
 
 	while (timeout-- && (status & I2C_BB)) {
-#if 1
-		volatile int temp;
 
 		mpc_reg_out (&regs->cr, I2C_STA, I2C_STA);
-		temp = mpc_reg_in (&regs->dr);
+		(void)mpc_reg_in (&regs->dr);
 		mpc_reg_out (&regs->cr, 0, I2C_STA);
 		mpc_reg_out (&regs->cr, 0, 0);
 		mpc_reg_out (&regs->cr, I2C_EN, 0);
-#endif
+
 		udelay (1000);
 		status = mpc_reg_in (&regs->sr);
 	}