diff --git a/drivers/i2c/i2c_common.c b/drivers/i2c/i2c_common.c index 6094ed12c77..616e15a2d03 100644 --- a/drivers/i2c/i2c_common.c +++ b/drivers/i2c/i2c_common.c @@ -35,15 +35,13 @@ void i2c_dump_msgs_rw(const struct device *dev, const struct i2c_msg *msgs, uint const bool dump_data = dump_read || !is_read; if (msg->len == 1 && dump_data) { - LOG_DBG(" %c %s%s len=01: %02x", is_read ? 'R' : 'W', - msg->flags & I2C_MSG_RESTART ? "Sr " : "", - msg->flags & I2C_MSG_STOP ? "P" : "", - msg->buf[0]); + LOG_DBG(" %c %2s %1s len=01: %02x", is_read ? 'R' : 'W', + msg->flags & I2C_MSG_RESTART ? "Sr" : "", + msg->flags & I2C_MSG_STOP ? "P" : "", msg->buf[0]); } else { - LOG_DBG(" %c %s%s len=%02x: ", is_read ? 'R' : 'W', - msg->flags & I2C_MSG_RESTART ? "Sr " : "", - msg->flags & I2C_MSG_STOP ? "P" : "", - msg->len); + LOG_DBG(" %c %2s %1s len=%02x: ", is_read ? 'R' : 'W', + msg->flags & I2C_MSG_RESTART ? "Sr" : "", + msg->flags & I2C_MSG_STOP ? "P" : "", msg->len); if (dump_data) { LOG_HEXDUMP_DBG(msg->buf, msg->len, "contents:"); }