Skip to contentSkip to conversation

Drivers: Base: Regmap: fix warnings, use %lu instead of %d for printf format

PATCH Superseded Chen Gang 3 participants 6 messages Apr 7, 2013

Subsystems (2)
lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 Drivers: Base: Regmap: fix warnings, use %lu instead of %d for printf format

fix warnings (with EXTRA_CFLAGS=-W):
format ‘%d’ expects argument of type ‘int’,
but argument 4 has type ‘size_t’ [-Wformat]

---
 drivers/base/regmap/regcache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/base/regmap/regcache.c +1 -1
index d81f605..275a2d2 100644
@@ -590,7 +590,7 @@ static int regcache_sync_block_raw_flush(struct regmap *map, const void **data,
 
 	count = cur - base;
 
-	dev_dbg(map->dev, "Writing %d bytes for %d registers from 0x%x-0x%x\n",
+	dev_dbg(map->dev, "Writing %lu bytes for %d registers from 0x%x-0x%x\n",
 		count * val_bytes, count, base, cur - 1);
 
 	map->cache_bypass = 1;
Signature · 1 line
1.7.7.6
#1 lore raw
Quoted 14 lines · Chen Gang

fix warnings (with EXTRA_CFLAGS=-W):
format ‘%d’ expects argument of type ‘int’,
but argument 4 has type ‘size_t’ [-Wformat]

---
 drivers/base/regmap/regcache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/base/regmap/regcache.c +0 -0
index d81f605..275a2d2 100644

drivers/base/regmap/regcache.c static int regcache_sync_block_raw_flush(struct regmap *map, const void **data, · line 596

Quoted 8 lines
drivers/base/regmap/regcache.c +1 -1
@@ -590,7 +590,7 @@ static int regcache_sync_block_raw_flush(struct regmap *map, const void **data,
 
 	count = cur - base;
 
-	dev_dbg(map->dev, "Writing %d bytes for %d registers from 0x%x-0x%x\n",
+	dev_dbg(map->dev, "Writing %lu bytes for %d registers from 0x%x-0x%x\n",
 		count * val_bytes, count, base, cur - 1);
 
 	map->cache_bypass = 1;

Please read Documentation/printk-formats.txt. Thanks.

Bjørn

author
#2 lore raw
Quoted 19 lines · Bjørn Mork
Quoted 17 lines · Chen Gang
Quoted 17 lines

fix warnings (with EXTRA_CFLAGS=-W):
format ‘%d’ expects argument of type ‘int’,
but argument 4 has type ‘size_t’ [-Wformat]

---
 drivers/base/regmap/regcache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/base/regmap/regcache.c +0 -0
index d81f605..275a2d2 100644
@@ -590,7 +590,7 @@ static int regcache_sync_block_raw_flush(struct regmap *map, const void **data,
 
 	count = cur - base;
 
Quoted 8 lines
Quoted 5 lines

drivers/base/regmap/regcache.c static int regcache_sync_block_raw_flush(struct regmap *map, const void **data, · line 596

Quoted 5 lines
drivers/base/regmap/regcache.c +1 -1
-	dev_dbg(map->dev, "Writing %d bytes for %d registers from 0x%x-0x%x\n",
+	dev_dbg(map->dev, "Writing %lu bytes for %d registers from 0x%x-0x%x\n",
 		count * val_bytes, count, base, cur - 1);
 
 	map->cache_bypass = 1;

Please read Documentation/printk-formats.txt. Thanks.

thanks, I will send patch v2 (I should use "%zu" instead of "%lu")

:-)

Quoted 4 lines

Bjørn

Signature · 3 lines
Chen Gang

Asianux Corporation
author
#3 lore raw

PATCH v2 1/1 Drivers: Base: Regmap: fix warnings, use %zu instead of %d for printf format

fix warnings (with EXTRA_CFLAGS=-W):
format ‘%d’ expects argument of type ‘int’,
but argument 4 has type ‘size_t’ [-Wformat]

---
 drivers/base/regmap/regcache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/base/regmap/regcache.c +1 -1
index d81f605..a469748 100644
@@ -590,7 +590,7 @@ static int regcache_sync_block_raw_flush(struct regmap *map, const void **data,
 
 	count = cur - base;
 
-	dev_dbg(map->dev, "Writing %d bytes for %d registers from 0x%x-0x%x\n",
+	dev_dbg(map->dev, "Writing %zu bytes for %d registers from 0x%x-0x%x\n",
 		count * val_bytes, count, base, cur - 1);
 
 	map->cache_bypass = 1;
Signature · 1 line
1.7.7.6
#4 lore raw

Re: [PATCH v2] Drivers: Base: Regmap: fix warnings, use %zu instead of %d for printf format

Quoted 6 lines · Chen Gang

fix warnings (with EXTRA_CFLAGS=-W):
format ‘%d’ expects argument of type ‘int’,
but argument 4 has type ‘size_t’ [-Wformat]

I've already applied a patch for this from someone else.

author
#5 lore raw

Re: [PATCH v2] Drivers: Base: Regmap: fix warnings, use %zu instead of %d for printf format

Quoted 8 lines · Mark Brown
Quoted 6 lines · Chen Gang
Quoted 6 lines

fix warnings (with EXTRA_CFLAGS=-W):
format ‘%d’ expects argument of type ‘int’,
but argument 4 has type ‘size_t’ [-Wformat]

I've already applied a patch for this from someone else.

ok, thanks.

it seems, I am too late !!

:-)

Signature · 3 lines
Chen Gang

Asianux Corporation