Skip to contentSkip to conversation

scsi: libsas: Use fallthrough pseudo-keyword

PATCH In review Wei Ming Chen 2 participants 2 messages May 31, 2021 – Jun 1, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
 drivers/scsi/libsas/sas_discover.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/libsas/sas_discover.c +1 -1
index 9f5068f3bcfb..dd205414e505 100644
@@ -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:
Signature · 1 line
2.25.1
#1 lore raw

+ Gustavo

Quoted 14 lines · Wei Ming Chen

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

---
  drivers/scsi/libsas/sas_discover.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/libsas/sas_discover.c +0 -0
index 9f5068f3bcfb..dd205414e505 100644

drivers/scsi/libsas/sas_discover.c static void sas_discover_domain(struct work_struct *work) · line 464

Quoted 5 lines
drivers/scsi/libsas/sas_discover.c +1 -1
@@ -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.

drivers/scsi/libsas/sas_discover.c static void sas_discover_domain(struct work_struct *work) · line 466

Quoted 2 lines
drivers/scsi/libsas/sas_discover.c +0 -0
  #endif
  		/* Fall through - only for the #else condition above. */

Thanks,
John

Quoted 2 lines
drivers/scsi/libsas/sas_discover.c +0 -0
  	default: