Skip to contentSkip to conversation

i2c: i2c-st: Use %pa to print 'resource_size_t' type

PATCH Applied Fabio Estevam 3 participants 3 messages Jul 10, 2014 – Jul 17, 2014 1 message not in the archive

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

PATCH 1/1 i2c: i2c-st: Use %pa to print 'resource_size_t' type

From: Fabio Estevam <[email protected]>

When building multi_v7_defconfig with CONFIG_ARM_LPAE=y the following warning is seen:

drivers/i2c/busses/i2c-st.c:818:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' [-Wformat=]

Use %pa to print 'resource_size_t' type to fix the warning.

---
 drivers/i2c/busses/i2c-st.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-st.c +1 -1
index 95b94767..fc767dd 100644
@@ -815,7 +815,7 @@ static int st_i2c_probe(struct platform_device *pdev)
 
 	adap = &i2c_dev->adap;
 	i2c_set_adapdata(adap, i2c_dev);
-	snprintf(adap->name, sizeof(adap->name), "ST I2C(0x%x)", res->start);
+	snprintf(adap->name, sizeof(adap->name), "ST I2C(0x%pa)", &res->start);
 	adap->owner = THIS_MODULE;
 	adap->timeout = 2 * HZ;
 	adap->retries = 0;
Signature · 1 line
1.8.3.2
#2 lore raw
In reply to a message not in the archive

Hi Fabio,

Quoted 8 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

When building multi_v7_defconfig with CONFIG_ARM_LPAE=y the following warning is seen:

drivers/i2c/busses/i2c-st.c:818:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' [-Wformat=]

Quoted 7 lines

Use %pa to print 'resource_size_t' type to fix the warning.

---
  drivers/i2c/busses/i2c-st.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

You can add my:

Thanks!
Maxime

Quoted 15 lines
drivers/i2c/busses/i2c-st.c +1 -1
index 95b94767..fc767dd 100644
@@ -815,7 +815,7 @@ static int st_i2c_probe(struct platform_device *pdev)
 
  	adap = &i2c_dev->adap;
  	i2c_set_adapdata(adap, i2c_dev);
-	snprintf(adap->name, sizeof(adap->name), "ST I2C(0x%x)", res->start);
+	snprintf(adap->name, sizeof(adap->name), "ST I2C(0x%pa)", &res->start);
  	adap->owner = THIS_MODULE;
  	adap->timeout = 2 * HZ;
  	adap->retries = 0;
Applied
#3 lore raw
In reply to a message not in the archive
Quoted 5 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

When building multi_v7_defconfig with CONFIG_ARM_LPAE=y the following warning is seen:

Quoted 7 lines

drivers/i2c/busses/i2c-st.c:818:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' [-Wformat=]

Use %pa to print 'resource_size_t' type to fix the warning.

Applied to for-current, thanks!