Skip to contentSkip to conversation

block: fix type for printf argument

PATCH New Ben Dooks 1 participant 1 message Jan 2 Block layer

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 block: fix type for printf argument

When making the block-%d id, the type should be %u. Fixes:

block/bio.c:92:62: warning: incorrect type in argument 4 (different types)
block/bio.c:92:62: expected int
block/bio.c:92:62: got unsigned int size

---
 block/bio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/bio.c +1 -1
index b3a79285c278..198b966d71b8 100644
@@ -89,7 +89,7 @@ static struct bio_slab *create_bio_slab(unsigned int size)
 	if (!bslab)
 		return NULL;
 
-	snprintf(bslab->name, sizeof(bslab->name), "bio-%d", size);
+	snprintf(bslab->name, sizeof(bslab->name), "bio-%u", size);
 	bslab->slab = kmem_cache_create(bslab->name, size,
 			ARCH_KMALLOC_MINALIGN,
 			SLAB_HWCACHE_ALIGN | SLAB_TYPESAFE_BY_RCU, NULL);
Signature · 1 line
2.37.2.352.g3c44437643