[U-Boot] [PATCH] common: cmd_mii: fix printf format warning

Jeroen Hofstee jeroen at myspectrum.nl
Sun Jul 13 23:44:21 CEST 2014


The and operator implicitly upcasts the value to
int, hence the format should expect an int type
as well. (and make checkpatch happy)

Signed-off-by: Jeroen Hofstee <jeroen at myspectrum.nl>
---
fixes clang warning:

common/cmd_mii.c:165:4: warning: format specifies type
'unsigned short' but the argument has type 'int' [-Wformat]
                        regval & mask_in_place,
                        ^~~~~~~~~~~~~~~~~~~~~~
---
 common/cmd_mii.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/cmd_mii.c b/common/cmd_mii.c
index b82a7ce..7c4a57a 100644
--- a/common/cmd_mii.c
+++ b/common/cmd_mii.c
@@ -160,10 +160,10 @@ static void dump_reg(
 
 		mask_in_place = pdesc->mask << pdesc->lo;
 
-		printf("  (%04hx:%04hx) %u.",
-			mask_in_place,
-			regval & mask_in_place,
-			prd->regno);
+		printf("  (%04hx:%04x) %u.",
+		       mask_in_place,
+		       regval & mask_in_place,
+		       prd->regno);
 
 		if (special_field(prd->regno, pdesc, regval)) {
 		}
-- 
1.8.3.2



More information about the U-Boot mailing list