Linux-mtd Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] ubifs: Fix ino_t format warnings in orphan_delete()
@ 2020-01-13 10:51 Geert Uytterhoeven
  2020-01-16 23:44 ` Richard Weinberger
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2020-01-13 10:51 UTC (permalink / raw)
  To: Richard Weinberger
  Cc: linux-s390, linux-mtd, linux-kernel, Geert Uytterhoeven, linux-alpha

On alpha and s390x:

    fs/ubifs/debug.h:158:11: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘ino_t {aka unsigned int}’ [-Wformat=]
    ...
    fs/ubifs/orphan.c:132:3: note: in expansion of macro ‘dbg_gen’
       dbg_gen("deleted twice ino %lu", orph->inum);
    ...
    fs/ubifs/orphan.c:140:3: note: in expansion of macro ‘dbg_gen’
       dbg_gen("delete later ino %lu", orph->inum);

__kernel_ino_t is "unsigned long" on most architectures, but not on
alpha and s390x, where it is "unsigned int".  Hence when printing an
ino_t, it should always be cast to "unsigned long" first.

Fix this by re-adding the recently removed casts.

Fixes: 8009ce956c3d2802 ("ubifs: Don't leak orphans on memory during commit")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 fs/ubifs/orphan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ubifs/orphan.c b/fs/ubifs/orphan.c
index 54d6db61106ffc45..edf43ddd7dce4779 100644
--- a/fs/ubifs/orphan.c
+++ b/fs/ubifs/orphan.c
@@ -129,7 +129,7 @@ static void __orphan_drop(struct ubifs_info *c, struct ubifs_orphan *o)
 static void orphan_delete(struct ubifs_info *c, struct ubifs_orphan *orph)
 {
 	if (orph->del) {
-		dbg_gen("deleted twice ino %lu", orph->inum);
+		dbg_gen("deleted twice ino %lu", (unsigned long)orph->inum);
 		return;
 	}
 
@@ -137,7 +137,7 @@ static void orphan_delete(struct ubifs_info *c, struct ubifs_orphan *orph)
 		orph->del = 1;
 		orph->dnext = c->orph_dnext;
 		c->orph_dnext = orph;
-		dbg_gen("delete later ino %lu", orph->inum);
+		dbg_gen("delete later ino %lu", (unsigned long)orph->inum);
 		return;
 	}
 
-- 
2.17.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ubifs: Fix ino_t format warnings in orphan_delete()
  2020-01-13 10:51 [PATCH] ubifs: Fix ino_t format warnings in orphan_delete() Geert Uytterhoeven
@ 2020-01-16 23:44 ` Richard Weinberger
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Weinberger @ 2020-01-16 23:44 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Richard Weinberger, linux-alpha, linux-mtd, LKML, linux-s390

On Mon, Jan 13, 2020 at 11:52 AM Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
>
> On alpha and s390x:
>
>     fs/ubifs/debug.h:158:11: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘ino_t {aka unsigned int}’ [-Wformat=]
>     ...
>     fs/ubifs/orphan.c:132:3: note: in expansion of macro ‘dbg_gen’
>        dbg_gen("deleted twice ino %lu", orph->inum);
>     ...
>     fs/ubifs/orphan.c:140:3: note: in expansion of macro ‘dbg_gen’
>        dbg_gen("delete later ino %lu", orph->inum);
>
> __kernel_ino_t is "unsigned long" on most architectures, but not on
> alpha and s390x, where it is "unsigned int".  Hence when printing an
> ino_t, it should always be cast to "unsigned long" first.
>
> Fix this by re-adding the recently removed casts.
>
> Fixes: 8009ce956c3d2802 ("ubifs: Don't leak orphans on memory during commit")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  fs/ubifs/orphan.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied! Thank you, Geert.

-- 
Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13 10:51 [PATCH] ubifs: Fix ino_t format warnings in orphan_delete() Geert Uytterhoeven
2020-01-16 23:44 ` Richard Weinberger

Linux-mtd Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mtd/0 linux-mtd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mtd linux-mtd/ https://lore.kernel.org/linux-mtd \
		linux-mtd@lists.infradead.org
	public-inbox-index linux-mtd

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mtd


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git