Message ID | 1405287861-6643-1-git-send-email-jeroen@myspectrum.nl |
---|---|
State | Accepted |
Delegated to: | Tom Rini |
Headers | show |
On Sun, Jul 13, 2014 at 11:44:21PM +0200, Jeroen Hofstee wrote: > 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@myspectrum.nl> Applied to u-boot/master, thanks!
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)) { }
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@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(-)