All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Chris Mason <clm@fb.com>, Josef Bacik <jbacik@fb.com>,
	David Sterba <dsterba@suse.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Qu Wenruo <wqu@suse.com>,
	Nikolay Borisov <nborisov@suse.com>,
	Su Yue <suy.fnst@cn.fujitsu.com>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] btrfs: fix size_t format string
Date: Tue, 17 Jul 2018 15:52:27 +0200	[thread overview]
Message-ID: <20180717135236.3673195-1-arnd@arndb.de> (raw)

The newly added check_block_group_item() function causes a build warning
on 32-bit architectures:

fs/btrfs/tree-checker.c: In function 'check_block_group_item':
fs/btrfs/tree-checker.c:404:41: error: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'unsigned int' [-Werror=format=]

The type of a sizeof() expression is size_t, which is correctly printed
using the %zu format string.

Fixes: 9dc16aad5660 ("btrfs: tree-checker: Verify block_group_item")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/btrfs/tree-checker.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index e9414c3f375e..4c82a628df85 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -401,7 +401,7 @@ static int check_block_group_item(struct btrfs_fs_info *fs_info,
 
 	if (item_size != sizeof(bgi)) {
 		block_group_err(fs_info, leaf, slot,
-			"invalid item size, have %u expect %lu",
+			"invalid item size, have %u expect %zu",
 				item_size, sizeof(bgi));
 		return -EUCLEAN;
 	}
-- 
2.9.0


             reply	other threads:[~2018-07-17 14:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17 13:52 Arnd Bergmann [this message]
2018-07-17 14:33 ` [PATCH] btrfs: fix size_t format string Qu Wenruo
2018-07-17 16:02   ` Arnd Bergmann
2018-07-17 15:04 ` David Sterba
2018-07-23 17:07   ` Randy Dunlap
2018-07-24  8:19     ` David Sterba
  -- strict thread matches above, loose matches on Subject: below --
2015-03-09 11:39 Arnd Bergmann
2015-03-09 11:39 ` Arnd Bergmann
2015-03-09 11:49 ` David Sterba
2015-03-09 11:49   ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180717135236.3673195-1-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=jbacik@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nborisov@suse.com \
    --cc=suy.fnst@cn.fujitsu.com \
    --cc=wqu@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.