2021-05-31 17:21:44

by Wei Ming Chen

[permalink] [raw]
Subject: [PATCH] scsi: libsas: Use fallthrough pseudo-keyword

Replace /* Fall through */ comment with pseudo-keyword macro fallthrough[1]

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Wei Ming Chen <[email protected]>
---
drivers/scsi/libsas/sas_discover.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c
index 9f5068f3bcfb..dd205414e505 100644
--- a/drivers/scsi/libsas/sas_discover.c
+++ b/drivers/scsi/libsas/sas_discover.c
@@ -461,7 +461,7 @@ static void sas_discover_domain(struct work_struct *work)
break;
#else
pr_notice("ATA device seen but CONFIG_SCSI_SAS_ATA=N so cannot attach\n");
- /* Fall through */
+ fallthrough;
#endif
/* Fall through - only for the #else condition above. */
default:
--
2.25.1


2021-06-01 08:18:38

by John Garry

[permalink] [raw]
Subject: Re: [PATCH] scsi: libsas: Use fallthrough pseudo-keyword

+ Gustavo

On 31/05/2021 16:37, Wei Ming Chen wrote:
> Replace /* Fall through */ comment with pseudo-keyword macro fallthrough[1]
>
> [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
>
> Signed-off-by: Wei Ming Chen <[email protected]>
> ---
> drivers/scsi/libsas/sas_discover.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c
> index 9f5068f3bcfb..dd205414e505 100644
> --- a/drivers/scsi/libsas/sas_discover.c
> +++ b/drivers/scsi/libsas/sas_discover.c
> @@ -461,7 +461,7 @@ static void sas_discover_domain(struct work_struct *work)
> break;
> #else
> pr_notice("ATA device seen but CONFIG_SCSI_SAS_ATA=N so cannot attach\n");
> - /* Fall through */
> + fallthrough;

I don't know why we need the 2nd fall through (and the compiler can't
see the first one) - added by Gustavo in da1fb2909 - but I think that
this one can now simply be removed.

> #endif
> /* Fall through - only for the #else condition above. */
Thanks,
John

> default:
>