Skip to contentSkip to conversation

i2c: remove h from printk format specifier

PATCH In review [email protected] 3 participants 3 messages Dec 15, 2020 – Jan 6, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: remove h from printk format specifier

From: Tom Rix <[email protected]>

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

---
 drivers/i2c/i2c-smbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/i2c-smbus.c +1 -1
index d3d06e3b4f3b..5cd2cf84659e 100644
@@ -396,7 +396,7 @@ void i2c_register_spd(struct i2c_adapter *adap)
 
 		if (!IS_ERR(i2c_new_scanned_device(adap, &info, addr_list, NULL))) {
 			dev_info(&adap->dev,
-				 "Successfully instantiated SPD at 0x%hx\n",
+				 "Successfully instantiated SPD at 0x%x\n",
 				 addr_list[0]);
 			dimm_count--;
 		}
Signature · 1 line
2.27.0
#1 lore raw
Quoted 6 lines · On Tue, Dec 15, 2020 at 10:33:27AM -0800, [email protected] wrote:

From: Tom Rix <[email protected]>

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Adding Jean to CC. Jean, I'd think %02x would be better, what do you think?

Quoted 20 lines
---
 drivers/i2c/i2c-smbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/i2c-smbus.c +1 -1
index d3d06e3b4f3b..5cd2cf84659e 100644
@@ -396,7 +396,7 @@ void i2c_register_spd(struct i2c_adapter *adap)
 
 		if (!IS_ERR(i2c_new_scanned_device(adap, &info, addr_list, NULL))) {
 			dev_info(&adap->dev,
-				 "Successfully instantiated SPD at 0x%hx\n",
+				 "Successfully instantiated SPD at 0x%x\n",
 				 addr_list[0]);
 			dimm_count--;
 		}
Signature · 1 line
2.27.0
Reviewed-by
#2 lore raw

Hi Tom, Wolfram,

Quoted 10 lines · Wolfram Sang
Quoted 6 lines · On Tue, Dec 15, 2020 at 10:33:27AM -0800, [email protected] wrote:

From: Tom Rix <[email protected]>

See Documentation/core-api/printk-formats.rst.
h should no longer be used in the format specifier for printk.

Adding Jean to CC. Jean, I'd think %02x would be better, what do you think?

Agreed, 0x%02x would be better.

If this is done then you can add:

Quoted 17 lines
Quoted 17 lines
---
 drivers/i2c/i2c-smbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/i2c-smbus.c +1 -1
index d3d06e3b4f3b..5cd2cf84659e 100644
@@ -396,7 +396,7 @@ void i2c_register_spd(struct i2c_adapter *adap)
 
 		if (!IS_ERR(i2c_new_scanned_device(adap, &info, addr_list, NULL))) {
 			dev_info(&adap->dev,
-				 "Successfully instantiated SPD at 0x%hx\n",
+				 "Successfully instantiated SPD at 0x%x\n",
 				 addr_list[0]);
 			dimm_count--;
 		}
Signature · 2 lines
Jean Delvare
SUSE L3 Support