linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org, Randy Dunlap <rdunlap@infradead.org>,
	Jan Kara <jack@suse.com>,
	linux-ext4@vger.kernel.org, Jan Kara <jack@suse.cz>,
	Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 4.4 091/100] ext2: fix empty body warnings when -Wextra is used
Date: Sat, 25 Apr 2020 04:47:17 -0700	[thread overview]
Message-ID: <67d97b191f3e015bf6a1ef0472cc30c4f57fdaaf.camel@perches.com> (raw)
In-Reply-To: <326458310dc7c982d2f2210e057f69d6bc0169c7.camel@perches.com>

On Sat, 2020-04-25 at 04:43 -0700, Joe Perches wrote:
> On Wed, 2020-04-22 at 11:57 +0200, Greg Kroah-Hartman wrote:
> > From: Randy Dunlap <rdunlap@infradead.org>
> > 
> > [ Upstream commit 44a52022e7f15cbaab957df1c14f7a4f527ef7cf ]
> > 
> > When EXT2_ATTR_DEBUG is not defined, modify the 2 debug macros
> > to use the no_printk() macro instead of <nothing>.
> > This fixes gcc warnings when -Wextra is used:
> > 
> > ../fs/ext2/xattr.c:252:42: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
> > ../fs/ext2/xattr.c:258:42: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
> > ../fs/ext2/xattr.c:330:42: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
> > ../fs/ext2/xattr.c:872:45: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
> > 
> > I have verified that the only object code change (with gcc 7.5.0) is
> > the reversal of some instructions from 'cmp a,b' to 'cmp b,a'.
> 
> It'd be better to use the ext4 style defines:
> 
> fs/ext4/xattr.c:# define ea_idebug(inode, fmt, ...)                                     \
> fs/ext4/xattr.c-        printk(KERN_DEBUG "inode %s:%lu: " fmt "\n",                    \
> fs/ext4/xattr.c-               inode->i_sb->s_id, inode->i_ino, ##__VA_ARGS__)
> fs/ext4/xattr.c:# define ea_bdebug(bh, fmt, ...)                                        \
> fs/ext4/xattr.c-        printk(KERN_DEBUG "block %pg:%lu: " fmt "\n",                   \
> fs/ext4/xattr.c-               bh->b_bdev, (unsigned long)bh->b_blocknr, ##__VA_ARGS__)
> --
> fs/ext4/xattr.c:# define ea_idebug(inode, fmt, ...)     no_printk(fmt, ##__VA_ARGS__)
> fs/ext4/xattr.c:# define ea_bdebug(bh, fmt, ...)        no_printk(fmt, ##__VA_ARGS__)
> 
> So the output logging won't be split across multiple lines.

And beyond that, why is a -Wextra warning being fixed in -stable at all?



      reply	other threads:[~2020-04-25 11:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200422095022.476101261@linuxfoundation.org>
2020-04-22  9:57 ` [PATCH 4.4 091/100] ext2: fix empty body warnings when -Wextra is used Greg Kroah-Hartman
2020-04-25 11:43   ` Joe Perches
2020-04-25 11:47     ` Joe Perches [this message]

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=67d97b191f3e015bf6a1ef0472cc30c4f57fdaaf.camel@perches.com \
    --to=joe@perches.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jack@suse.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /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).