linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: "Andreas Färber" <afaerber@suse.de>
Cc: linux-arm-kernel@lists.infradead.org,
	Josef Bacik <josef@toxicpanda.com>,
	linux-kernel@vger.kernel.org, Chris Mason <clm@fb.com>,
	Qu Wenruo <wqu@suse.com>, Johannes Thumshirn <jthumshirn@suse.de>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH next 1/2] btrfs: tree-checker: Fix error format string
Date: Mon, 11 Nov 2019 19:31:58 +0100	[thread overview]
Message-ID: <20191111183158.GT3001@twin.jikos.cz> (raw)
In-Reply-To: <20191108213853.16635-2-afaerber@suse.de>

On Fri, Nov 08, 2019 at 10:38:52PM +0100, Andreas Färber wrote:
> From: Andreas Färber <afaerber@suse.com>
> 
> Argument BTRFS_FILE_EXTENT_INLINE_DATA_START is defined as offsetof(),
> which returns type size_t, so we need %zu instead of %lu.
> 
> This fixes a build warning on 32-bit arm:
> 
>   ../fs/btrfs/tree-checker.c: In function 'check_extent_data_item':
>   ../fs/btrfs/tree-checker.c:230:43: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Wformat=]
>     230 |     "invalid item size, have %u expect [%lu, %u)",
>         |                                         ~~^
>         |                                           |
>         |                                           long unsigned int
>         |                                         %u

Is there a gcc warning option that can catch that on 64bit too?
-Wformat=2 does not and I don't see any other of the option family to do
that. We've had fixups of the size_t printk formats and I'd like to
catch that when the patches are added to the devel branches. I can't run
32bit build check each time but this seems to be the only way so far.

> Fixes: a31ccb4b7ba2 ("btrfs: tree-checker: Check item size before reading file extent type")

As the patch is still in the devel branch, the commit id is not stable
and I'll fold the change to to the patch. Thanks.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-11-11 18:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08 21:38 [PATCH next 0/2] btrfs: Fix build warnings for arm Andreas Färber
2019-11-08 21:38 ` [PATCH next 1/2] btrfs: tree-checker: Fix error format string Andreas Färber
2019-11-11 18:31   ` David Sterba [this message]
2019-11-26 10:36     ` Geert Uytterhoeven
2019-11-26 15:44       ` David Sterba
2019-11-08 21:38 ` [PATCH next 2/2] btrfs: extent-tree: " Andreas Färber

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=20191111183158.GT3001@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=afaerber@suse.de \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).