platform/chrome: cros_ec_typec: fix clang -Wformat warning
authorArnd Bergmann <arnd@arndb.de>
Mon, 22 Mar 2021 11:55:55 +0000 (12:55 +0100)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>
Tue, 30 Mar 2021 16:28:50 +0000 (18:28 +0200)
commitc6e939c63c80c26460b25cf1150ebe8396e8adcf
treed196450fc73005ccbdf73002b5ecd16475c36cbf
parent639ff208cb37c5a3f0198e62d04962b677d25c9c
platform/chrome: cros_ec_typec: fix clang -Wformat warning

Clang warns about using the %h format modifier to truncate an
integer:

drivers/platform/chrome/cros_ec_typec.c:1031:3: error: format specifies type 'unsigned char' but the argument has type 'unsigned int' [-Werror,-Wformat]
                typec->pd_ctrl_ver);
                ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:131:47: note: expanded from macro 'dev_dbg'
                dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
                                                    ~~~     ^~~~~~~~~~~

Use an explicit bit mask to limit the number to its lower eight bits
instead.

Fixes: ad7c0510c99e ("platform/chrome: cros_ec_typec: Update port info from EC")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20210322115602.4003221-1-arnd@kernel.org
drivers/platform/chrome/cros_ec_typec.c