Skip to content

Commit

Permalink
iio: light: si1145: Drop use of %hhx format specifier.
Browse files Browse the repository at this point in the history
Since:
commit cbacb5a ("docs: printk-formats: Stop encouraging use of
unnecessary %h[xudi] and %hh[xudi]")
use of these format strings has been discouraged.

As there are only a few such instances in IIO, this is part of a
series clearing them out so they don't get copied into new drivers.

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.

Signed-off-by: Jonathan Cameron <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
jic23 committed Jun 9, 2021
1 parent e8951f0 commit c9d52c8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/iio/light/si1145.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ static int si1145_command(struct si1145_data *data, u8 cmd)
if ((ret & ~SI1145_RSP_COUNTER_MASK) == 0) {
if (ret == data->rsp_seq) {
if (time_after(jiffies, stop_jiffies)) {
dev_warn(dev, "timeout on command %#02hhx\n",
dev_warn(dev, "timeout on command 0x%02x\n",
cmd);
ret = -ETIMEDOUT;
break;
Expand All @@ -291,12 +291,12 @@ static int si1145_command(struct si1145_data *data, u8 cmd)
ret = -EIO;
} else {
if (ret == SI1145_RSP_INVALID_SETTING) {
dev_warn(dev, "INVALID_SETTING error on command %#02hhx\n",
dev_warn(dev, "INVALID_SETTING error on command 0x%02x\n",
cmd);
ret = -EINVAL;
} else {
/* All overflows are treated identically */
dev_dbg(dev, "overflow, ret=%d, cmd=%#02hhx\n",
dev_dbg(dev, "overflow, ret=%d, cmd=0x%02x\n",
ret, cmd);
ret = -EOVERFLOW;
}
Expand Down Expand Up @@ -1299,10 +1299,10 @@ static int si1145_probe(struct i2c_client *client,
SI1145_REG_SEQ_ID);
if (ret < 0)
return ret;
dev_info(&client->dev, "device ID part %#02hhx rev %#02hhx seq %#02hhx\n",
dev_info(&client->dev, "device ID part 0x%02x rev 0x%02x seq 0x%02x\n",
part_id, rev_id, seq_id);
if (part_id != data->part_info->part) {
dev_err(&client->dev, "part ID mismatch got %#02hhx, expected %#02x\n",
dev_err(&client->dev, "part ID mismatch got 0x%02x, expected 0x%02x\n",
part_id, data->part_info->part);
return -ENODEV;
}
Expand Down

0 comments on commit c9d52c8

Please sign in to comment.