* [PATCH] cifs: Convert to use the fallthrough macro
@ 2020-08-08 8:36 linmiaohe
2020-08-09 16:46 ` Steve French
2020-08-10 17:08 ` Steve French
0 siblings, 2 replies; 5+ messages in thread
From: linmiaohe @ 2020-08-08 8:36 UTC (permalink / raw)
To: sfrench; +Cc: linux-cifs, samba-technical, linux-kernel, linmiaohe
From: Miaohe Lin <linmiaohe@huawei.com>
Convert the uses of fallthrough comments to fallthrough macro.
Signed-off-by: Hongxiang Lou <louhongxiang@huawei.com>
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
fs/cifs/smb2pdu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 24c2ac360591..667d70aa335f 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -3913,7 +3913,7 @@ smb2_readv_callback(struct mid_q_entry *mid)
case MID_RESPONSE_MALFORMED:
credits.value = le16_to_cpu(shdr->CreditRequest);
credits.instance = server->reconnect_instance;
- /* fall through */
+ fallthrough;
default:
rdata->result = -EIO;
}
@@ -4146,7 +4146,7 @@ smb2_writev_callback(struct mid_q_entry *mid)
case MID_RESPONSE_MALFORMED:
credits.value = le16_to_cpu(rsp->sync_hdr.CreditRequest);
credits.instance = server->reconnect_instance;
- /* fall through */
+ fallthrough;
default:
wdata->result = -EIO;
break;
--
2.19.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] cifs: Convert to use the fallthrough macro
2020-08-08 8:36 [PATCH] cifs: Convert to use the fallthrough macro linmiaohe
@ 2020-08-09 16:46 ` Steve French
2020-08-09 17:07 ` Joe Perches
2020-08-10 17:08 ` Steve French
1 sibling, 1 reply; 5+ messages in thread
From: Steve French @ 2020-08-09 16:46 UTC (permalink / raw)
To: linmiaohe; +Cc: Steve French, CIFS, samba-technical, LKML
Is this conversion from "/* Fallthrough */" to the preferred (?)
"fallthrough;" documented anywhere?
All I see is a few fs changesets like:
commit c730ae0c6bb3125ccb776fb2ab6abbdff500c02c
Author: Marcos Paulo de Souza <mpdesouza@suse.com>
Date: Tue Jun 16 15:54:29 2020 -0300
btrfs: convert comments to fallthrough annotations
Convert fall through comments to the pseudo-keyword which is now the
preferred way.
And the vast majority of places (33 vs. 4) use "/* Fallthrough */ in
the fs directory
On Sat, Aug 8, 2020 at 3:34 AM linmiaohe <linmiaohe@huawei.com> wrote:
>
> From: Miaohe Lin <linmiaohe@huawei.com>
>
> Convert the uses of fallthrough comments to fallthrough macro.
>
> Signed-off-by: Hongxiang Lou <louhongxiang@huawei.com>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
> fs/cifs/smb2pdu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
> index 24c2ac360591..667d70aa335f 100644
> --- a/fs/cifs/smb2pdu.c
> +++ b/fs/cifs/smb2pdu.c
> @@ -3913,7 +3913,7 @@ smb2_readv_callback(struct mid_q_entry *mid)
> case MID_RESPONSE_MALFORMED:
> credits.value = le16_to_cpu(shdr->CreditRequest);
> credits.instance = server->reconnect_instance;
> - /* fall through */
> + fallthrough;
> default:
> rdata->result = -EIO;
> }
> @@ -4146,7 +4146,7 @@ smb2_writev_callback(struct mid_q_entry *mid)
> case MID_RESPONSE_MALFORMED:
> credits.value = le16_to_cpu(rsp->sync_hdr.CreditRequest);
> credits.instance = server->reconnect_instance;
> - /* fall through */
> + fallthrough;
> default:
> wdata->result = -EIO;
> break;
> --
> 2.19.1
>
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cifs: Convert to use the fallthrough macro
2020-08-09 16:46 ` Steve French
@ 2020-08-09 17:07 ` Joe Perches
0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2020-08-09 17:07 UTC (permalink / raw)
To: Steve French, linmiaohe; +Cc: Steve French, CIFS, samba-technical, LKML
On Sun, 2020-08-09 at 11:46 -0500, Steve French wrote:
> Is this conversion from "/* Fallthrough */" to the preferred (?)
> "fallthrough;" documented anywhere?
Documentation/process/deprecated.rst
As there have been a long list of flaws `due to missing "break" statements
<https://cwe.mitre.org/data/definitions/484.html>`_, we no longer allow
implicit fall-through. In order to identify intentional fall-through
cases, we have adopted a pseudo-keyword macro "fallthrough" which
expands to gcc's extension `__attribute__((__fallthrough__))
<https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html>`_.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cifs: Convert to use the fallthrough macro
2020-08-08 8:36 [PATCH] cifs: Convert to use the fallthrough macro linmiaohe
2020-08-09 16:46 ` Steve French
@ 2020-08-10 17:08 ` Steve French
1 sibling, 0 replies; 5+ messages in thread
From: Steve French @ 2020-08-10 17:08 UTC (permalink / raw)
To: linmiaohe; +Cc: Steve French, CIFS, samba-technical, LKML
merged into cifs-2.6.git for-next
(but note that most places in fs directory other than cifs and btrfs
have not been updated), and I noticed another 8 places in fs/cifs that
you didn't change in your patch (ie change from the older way of
indicating fallthrough /* Fallthrough */ as a comment to the newer
fallthrough macro.
On Sat, Aug 8, 2020 at 3:34 AM linmiaohe <linmiaohe@huawei.com> wrote:
>
> From: Miaohe Lin <linmiaohe@huawei.com>
>
> Convert the uses of fallthrough comments to fallthrough macro.
>
> Signed-off-by: Hongxiang Lou <louhongxiang@huawei.com>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
> fs/cifs/smb2pdu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
> index 24c2ac360591..667d70aa335f 100644
> --- a/fs/cifs/smb2pdu.c
> +++ b/fs/cifs/smb2pdu.c
> @@ -3913,7 +3913,7 @@ smb2_readv_callback(struct mid_q_entry *mid)
> case MID_RESPONSE_MALFORMED:
> credits.value = le16_to_cpu(shdr->CreditRequest);
> credits.instance = server->reconnect_instance;
> - /* fall through */
> + fallthrough;
> default:
> rdata->result = -EIO;
> }
> @@ -4146,7 +4146,7 @@ smb2_writev_callback(struct mid_q_entry *mid)
> case MID_RESPONSE_MALFORMED:
> credits.value = le16_to_cpu(rsp->sync_hdr.CreditRequest);
> credits.instance = server->reconnect_instance;
> - /* fall through */
> + fallthrough;
> default:
> wdata->result = -EIO;
> break;
> --
> 2.19.1
>
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cifs: Convert to use the fallthrough macro
@ 2020-08-11 2:11 linmiaohe
0 siblings, 0 replies; 5+ messages in thread
From: linmiaohe @ 2020-08-11 2:11 UTC (permalink / raw)
To: Steve French; +Cc: Steve French, CIFS, samba-technical, LKML
Steve French <smfrench@gmail.com> wrote:
>
>merged into cifs-2.6.git for-next
>
Many thanks.
> (but note that most places in fs directory other than cifs and btrfs have not been updated), and I noticed another 8 places in fs/cifs that you didn't change in your patch (ie change from the older way of
>indicating fallthrough /* Fallthrough */ as a comment to the newer
>fallthrough macro.
>
I'am sorry, I missed that. I would fix another 8 places in fs/cifs soon.
Thanks.
>
>--
>Thanks,
>
>Steve
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-08-11 2:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-08 8:36 [PATCH] cifs: Convert to use the fallthrough macro linmiaohe
2020-08-09 16:46 ` Steve French
2020-08-09 17:07 ` Joe Perches
2020-08-10 17:08 ` Steve French
2020-08-11 2:11 linmiaohe
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).