Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: light: si1133: Drop remaining uses of %hhx format string.

Since:
commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of
unnecessary %h[xudi] and %hh[xudi]")
use of these format strings has been discouraged.

Use the 0x02x form as the length specifier when used with # includes
the 0x prefix and is very unlikely to be what was intended by the author.

As there are not that many in IIO, this is part of an effort to clear
them out so we don't have any instances that might get copied into
new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20210603180612.3635250-3-jic23@kernel.org

+7 -7
+7 -7
drivers/iio/light/si1133.c
··· 352 352 353 353 switch (resp) { 354 354 case SI1133_ERR_OUTPUT_BUFFER_OVERFLOW: 355 - dev_warn(dev, "Output buffer overflow: %#02hhx\n", cmd); 355 + dev_warn(dev, "Output buffer overflow: 0x%02x\n", cmd); 356 356 return -EOVERFLOW; 357 357 case SI1133_ERR_SATURATION_ADC_OR_OVERFLOW_ACCUMULATION: 358 - dev_warn(dev, "Saturation of the ADC or overflow of accumulation: %#02hhx\n", 358 + dev_warn(dev, "Saturation of the ADC or overflow of accumulation: 0x%02x\n", 359 359 cmd); 360 360 return -EOVERFLOW; 361 361 case SI1133_ERR_INVALID_LOCATION_CMD: 362 362 dev_warn(dev, 363 - "Parameter access to an invalid location: %#02hhx\n", 363 + "Parameter access to an invalid location: 0x%02x\n", 364 364 cmd); 365 365 return -EINVAL; 366 366 case SI1133_ERR_INVALID_CMD: 367 - dev_warn(dev, "Invalid command %#02hhx\n", cmd); 367 + dev_warn(dev, "Invalid command 0x%02x\n", cmd); 368 368 return -EINVAL; 369 369 default: 370 - dev_warn(dev, "Unknown error %#02hhx\n", cmd); 370 + dev_warn(dev, "Unknown error 0x%02x\n", cmd); 371 371 return -EINVAL; 372 372 } 373 373 } ··· 400 400 401 401 err = regmap_write(data->regmap, SI1133_REG_COMMAND, cmd); 402 402 if (err) { 403 - dev_warn(dev, "Failed to write command %#02hhx, ret=%d\n", cmd, 403 + dev_warn(dev, "Failed to write command 0x%02x, ret=%d\n", cmd, 404 404 err); 405 405 goto out; 406 406 } ··· 425 425 SI1133_CMD_TIMEOUT_MS * 1000); 426 426 if (err) { 427 427 dev_warn(dev, 428 - "Failed to read command %#02hhx, ret=%d\n", 428 + "Failed to read command 0x%02x, ret=%d\n", 429 429 cmd, err); 430 430 goto out; 431 431 }