Skip to contentSkip to conversation

block: Fix type mismatch in ssize_t_blk_mq_tag_sysfs_show

PATCH Applied Masanari Iida 2 participants 2 messages Feb 10, 2014 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: Fix type mismatch in ssize_t_blk_mq_tag_sysfs_show

cppcheck detected following format string mismatch. [blk-mq-tag.c:201]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'int'.

Change "cpu" from int to unsigned int, because the cpu never become minus value.

---
 block/blk-mq-tag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-mq-tag.c +1 -1
index 5d70edc..83ae96c 100644
@@ -184,7 +184,7 @@ void blk_mq_free_tags(struct blk_mq_tags *tags)
 ssize_t blk_mq_tag_sysfs_show(struct blk_mq_tags *tags, char *page)
 {
 	char *orig_page = page;
-	int cpu;
+	unsigned int cpu;
 
 	if (!tags)
 		return 0;
Signature · 1 line
1.9.rc1
maintainer Applied
#1 lore raw
Quoted 6 lines · Masanari Iida

cppcheck detected following format string mismatch. [blk-mq-tag.c:201]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'int'.

Change "cpu" from int to unsigned int, because the cpu never become minus value.

Thanks, applied.

Signature · 1 line
Jens Axboe