Patchwork [U-Boot,2/2] arch/powerpc/cpu/mpc512x/i2c.c: Fix GCC 4.6 warnings

login
register
mail settings
Submitter Anatolij Gustschin
Date Nov. 10, 2011, 10:21 p.m.
Message ID <1320963704-568-2-git-send-email-agust@denx.de>
Download mbox | patch
Permalink /patch/125009/
State Accepted
Commit d14a94bf686bdcee71924c8bbf76ef67b0b4bb0f
Headers show

Comments

Anatolij Gustschin - Nov. 10, 2011, 10:21 p.m.
Fix:
i2c.c: In function 'wait_for_bb':
i2c.c:81:16: warning: variable 'temp' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 arch/powerpc/cpu/mpc512x/i2c.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Wolfgang Denk - Nov. 16, 2011, 8:13 p.m.
Dear Anatolij Gustschin,

In message <1320963704-568-2-git-send-email-agust@denx.de> you wrote:
> Fix:
> i2c.c: In function 'wait_for_bb':
> i2c.c:81:16: warning: variable 'temp' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>  arch/powerpc/cpu/mpc512x/i2c.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/arch/powerpc/cpu/mpc512x/i2c.c b/arch/powerpc/cpu/mpc512x/i2c.c
index e2d9097..0ea1280 100644
--- a/arch/powerpc/cpu/mpc512x/i2c.c
+++ b/arch/powerpc/cpu/mpc512x/i2c.c
@@ -78,9 +78,8 @@  static int wait_for_bb (void)
 	status = mpc_reg_in (&regs->msr);
 
 	while (timeout-- && (status & I2C_BB)) {
-		volatile int temp;
 		mpc_reg_out (&regs->mcr, I2C_STA, I2C_STA);
-		temp = mpc_reg_in (&regs->mdr);
+		(void)mpc_reg_in(&regs->mdr);
 		mpc_reg_out (&regs->mcr, 0, I2C_STA);
 		mpc_reg_out (&regs->mcr, 0, 0);
 		mpc_reg_out (&regs->mcr, I2C_EN, 0);