Patchwork [U-Boot] common/cmd_mdio.c: fix compile warning

login
register
mail settings
Submitter Anatolij Gustschin
Date April 30, 2011, 12:39 p.m.
Message ID <1304167169-22651-1-git-send-email-agust@denx.de>
Download mbox | patch
Permalink /patch/93502/
State Accepted
Commit a621b167baa62871f6b1b10020c230905a8f832c
Headers show

Comments

Anatolij Gustschin - April 30, 2011, 12:39 p.m.
cmd_mdio.c: In function 'mdio_read_ranges':
cmd_mdio.c:97: warning: comparison is always false due to limited range of data type

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Andy Fleming <afleming@freescale.com>
---
 common/cmd_mdio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Wolfgang Denk - April 30, 2011, 9:09 p.m.
Dear Anatolij Gustschin,

In message <1304167169-22651-1-git-send-email-agust@denx.de> you wrote:
> cmd_mdio.c: In function 'mdio_read_ranges':
> cmd_mdio.c:97: warning: comparison is always false due to limited range of data type
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> Cc: Andy Fleming <afleming@freescale.com>
> ---
>  common/cmd_mdio.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/common/cmd_mdio.c b/common/cmd_mdio.c
index cac0703..4ac9de4 100644
--- a/common/cmd_mdio.c
+++ b/common/cmd_mdio.c
@@ -91,9 +91,9 @@  int mdio_read_ranges(struct mii_dev *bus, int addrlo,
 
 		for (devad = devadlo; devad <= devadhi; devad++) {
 			for (reg = reglo; reg <= reghi; reg++) {
-				u16 val;
-				val = bus->read(bus, addr, devad, reg);
+				int val;
 
+				val = bus->read(bus, addr, devad, reg);
 				if (val < 0) {
 					printf("Error\n");