From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: "Darrick J. Wong" <djwong@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org,
Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH][next] xfs: Fix fall-through warnings for Clang
Date: Wed, 26 May 2021 13:21:06 -0500 [thread overview]
Message-ID: <bcae9d46-644c-d6f6-3df5-e8f7c50a673d@embeddedor.com> (raw)
In-Reply-To: <62895e8c-800d-fa7b-15f6-480179d552be@embeddedor.com>
On 4/20/21 18:56, Gustavo A. R. Silva wrote:
>
>
> On 4/20/21 18:38, Darrick J. Wong wrote:
>> On Tue, Apr 20, 2021 at 06:06:52PM -0500, Gustavo A. R. Silva wrote:
>>> In preparation to enable -Wimplicit-fallthrough for Clang, fix
>>> the following warnings by replacing /* fall through */ comments,
>>> and its variants, with the new pseudo-keyword macro fallthrough:
>>>
>>> fs/xfs/libxfs/xfs_alloc.c:3167:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/libxfs/xfs_da_btree.c:286:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/libxfs/xfs_ag_resv.c:346:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/libxfs/xfs_ag_resv.c:388:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/xfs_bmap_util.c:246:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/xfs_export.c:88:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/xfs_export.c:96:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/xfs_file.c:867:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/xfs_ioctl.c:562:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/xfs_ioctl.c:1548:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/xfs_iomap.c:1040:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/xfs_inode.c:852:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/xfs_log.c:2627:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/xfs_trans_buf.c:298:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/scrub/bmap.c:275:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/scrub/btree.c:48:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/scrub/common.c:85:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/scrub/common.c:138:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/scrub/common.c:698:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/scrub/dabtree.c:51:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>> fs/xfs/scrub/repair.c:951:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
>>>
>>> Notice that Clang doesn't recognize /* fall through */ comments as
>>> implicit fall-through markings, so in order to globally enable
>>> -Wimplicit-fallthrough for Clang, these comments need to be
>>> replaced with fallthrough; in the whole codebase.
>>>
>>> Link: https://github.com/KSPP/linux/issues/115
>>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>>
>> I've already NAKd this twice, so I guess I'll NAK it a third time.
>
> Darrick,
>
> The adoption of fallthrough; has been already accepted and in use since Linux v5.7:
>
> https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
>
> This change is needed, and I would really prefer if this goes upstream through your tree.
>
> Linus has taken these patches directly for a while, now.
>
> Could you consider taking it this time? :)
>
Hi Darrick,
If you don't mind, I will take this in my -next[1] branch for v5.14, so we can globally enable
-Wimplicit-fallthrough for Clang in that release.
We had thousands of these warnings and now we are down to 47 in next-20210526,
22 of which are fixed with this patch.
Thanks
--
Gustavo
[1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp
next prev parent reply other threads:[~2021-05-26 18:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-20 23:06 [PATCH][next] xfs: Fix fall-through warnings for Clang Gustavo A. R. Silva
2021-04-20 23:38 ` Darrick J. Wong
2021-04-20 23:56 ` Gustavo A. R. Silva
2021-05-26 18:21 ` Gustavo A. R. Silva [this message]
2021-05-26 21:16 ` Darrick J. Wong
2021-05-27 21:31 ` Kees Cook
2021-05-28 0:34 ` Darrick J. Wong
2021-05-28 16:48 ` Kees Cook
2021-06-02 0:32 ` Dave Chinner
2021-04-21 3:11 ` Joe Perches
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=bcae9d46-644c-d6f6-3df5-e8f7c50a673d@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=djwong@kernel.org \
--cc=gustavoars@kernel.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@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