Discussion:
[PATCH resend 1/2] bcache: Use %zi to format size_t
Geert Uytterhoeven
2014-02-03 13:49:46 UTC
Permalink
drivers/md/bcache/extents.c: In function =E2=80=98btree_ptr_bad_expensi=
ve=E2=80=99:
drivers/md/bcache/extents.c:196: warning: format =E2=80=98%li=E2=80=99 =
expects type =E2=80=98long int=E2=80=99, but argument 4 has type =E2=80=
=98size_t=E2=80=99

Signed-off-by: Geert Uytterhoeven <***@linux-m68k.org>
---
Issue has migrated from linux-next to Linus' tree

drivers/md/bcache/extents.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/bcache/extents.c b/drivers/md/bcache/extents.c
index c3ead586dc27..416d1a3e028e 100644
--- a/drivers/md/bcache/extents.c
+++ b/drivers/md/bcache/extents.c
@@ -194,7 +194,7 @@ err:
mutex_unlock(&b->c->bucket_lock);
bch_extent_to_text(buf, sizeof(buf), k);
btree_bug(b,
-"inconsistent btree pointer %s: bucket %li pin %i prio %i gen %i last_=
gc %i mark %llu gc_gen %i",
+"inconsistent btree pointer %s: bucket %zi pin %i prio %i gen %i last_=
gc %i mark %llu gc_gen %i",
buf, PTR_BUCKET_NR(b->c, k, i), atomic_read(&g->pin),
g->prio, g->gen, g->last_gc, GC_MARK(g), g->gc_gen);
return true;
--=20
1.7.9.5
Geert Uytterhoeven
2014-02-03 13:49:47 UTC
Permalink
drivers/md/bcache/btree.c: In function =E2=80=98insert_u64s_remaining=E2=
=80=99:
drivers/md/bcache/btree.c:1816: warning: comparison of distinct pointer=
types lacks a cast

Signed-off-by: Geert Uytterhoeven <***@linux-m68k.org>
---
Issue has migrated from linux-next to Linus' tree

v2: Drop L-suffix instead of using max_t(ssize_t, ...), as suggested by=
Joe
Perches

drivers/md/bcache/btree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 98cc0a810a36..f08e48f12291 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -1813,7 +1813,7 @@ static size_t insert_u64s_remaining(struct btree =
*b)
if (b->keys.ops->is_extents)
ret -=3D KEY_MAX_U64S;
=20
- return max(ret, 0L);
+ return max(ret, 0);
}
=20
static bool bch_btree_insert_keys(struct btree *b, struct btree_op *op=
,
--=20
1.7.9.5
Ian Pilcher
2014-02-03 17:34:49 UTC
Permalink
Shouldn't size_t use %zu?
--
========================================================================
Ian Pilcher ***@gmail.com
Sent from the cloud -- where it's already tomorrow
========================================================================
Geert Uytterhoeven
2014-02-03 18:49:25 UTC
Permalink
Post by Ian Pilcher
Shouldn't size_t use %zu?
Technically yes. %zi/%zd prints signed numbers (ssize_t), while %zu prints
unsigned (size_t).

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ***@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

Loading...