linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 006/491] ARM/RISCPC ARCHITECTURE: Use fallthrough;
       [not found] <cover.1583896344.git.joe@perches.com>
@ 2020-03-11  4:51 ` Joe Perches
  2020-03-12 10:11   ` Russell King - ARM Linux admin
  2020-03-11  4:51 ` [PATCH -next 020/491] XEN HYPERVISOR INTERFACE: " Joe Perches
  1 sibling, 1 reply; 5+ messages in thread
From: Joe Perches @ 2020-03-11  4:51 UTC (permalink / raw)
  To: Russell King
  Cc: James E.J. Bottomley, Martin K. Petersen, linux-arm-kernel,
	linux-kernel, linux-scsi

Convert the various uses of fallthrough comments to fallthrough;

Done via script
Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe.com/

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/arm/mach-rpc/riscpc.c |  2 +-
 drivers/scsi/arm/fas216.c  | 17 ++++++-----------
 2 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index ea2c842..d23970b 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -46,7 +46,7 @@ static int __init parse_tag_acorn(const struct tag *tag)
 	switch (tag->u.acorn.vram_pages) {
 	case 512:
 		vram_size += PAGE_SIZE * 256;
-		/* Fall through - ??? */
+		fallthrough;	/* ??? */
 	case 256:
 		vram_size += PAGE_SIZE * 256;
 	default:
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
index 6c68c230..bb18be 100644
--- a/drivers/scsi/arm/fas216.c
+++ b/drivers/scsi/arm/fas216.c
@@ -603,8 +603,7 @@ static void fas216_handlesync(FAS216_Info *info, char *msg)
 		msgqueue_flush(&info->scsi.msgs);
 		msgqueue_addmsg(&info->scsi.msgs, 1, MESSAGE_REJECT);
 		info->scsi.phase = PHASE_MSGOUT_EXPECT;
-		/* fall through */
-
+		fallthrough;
 	case async:
 		dev->period = info->ifcfg.asyncperiod / 4;
 		dev->sof    = 0;
@@ -916,8 +915,7 @@ static void fas216_disconnect_intr(FAS216_Info *info)
 			fas216_done(info, DID_ABORT);
 			break;
 		}
-		/* else, fall through */
-
+		fallthrough;
 	default:				/* huh?					*/
 		printk(KERN_ERR "scsi%d.%c: unexpected disconnect in phase %s\n",
 			info->host->host_no, fas216_target(info), fas216_drv_phase(info));
@@ -1413,8 +1411,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne
 	case STATE(STAT_STATUS, PHASE_DATAOUT): /* Data Out     -> Status       */
 	case STATE(STAT_STATUS, PHASE_DATAIN):  /* Data In      -> Status       */
 		fas216_stoptransfer(info);
-		/* fall through */
-
+		fallthrough;
 	case STATE(STAT_STATUS, PHASE_SELSTEPS):/* Sel w/ steps -> Status       */
 	case STATE(STAT_STATUS, PHASE_MSGOUT):  /* Message Out  -> Status       */
 	case STATE(STAT_STATUS, PHASE_COMMAND): /* Command      -> Status       */
@@ -1426,8 +1423,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne
 	case STATE(STAT_MESGIN, PHASE_DATAOUT): /* Data Out     -> Message In   */
 	case STATE(STAT_MESGIN, PHASE_DATAIN):  /* Data In      -> Message In   */
 		fas216_stoptransfer(info);
-		/* fall through */
-
+		fallthrough;
 	case STATE(STAT_MESGIN, PHASE_COMMAND):	/* Command	-> Message In	*/
 	case STATE(STAT_MESGIN, PHASE_SELSTEPS):/* Sel w/ steps -> Message In   */
 	case STATE(STAT_MESGIN, PHASE_MSGOUT):  /* Message Out  -> Message In   */
@@ -1581,8 +1577,7 @@ static void fas216_funcdone_intr(FAS216_Info *info, unsigned int stat, unsigned
 			fas216_message(info);
 			break;
 		}
-		/* else, fall through */
-
+		fallthrough;
 	default:
 		fas216_log(info, 0, "internal phase %s for function done?"
 			"  What do I do with this?",
@@ -1964,7 +1959,7 @@ static void fas216_kick(FAS216_Info *info)
 	switch (where_from) {
 	case TYPE_QUEUE:
 		fas216_allocate_tag(info, SCpnt);
-		/* fall through */
+		fallthrough;
 	case TYPE_OTHER:
 		fas216_start_command(info, SCpnt);
 		break;
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH -next 020/491] XEN HYPERVISOR INTERFACE: Use fallthrough;
       [not found] <cover.1583896344.git.joe@perches.com>
  2020-03-11  4:51 ` [PATCH -next 006/491] ARM/RISCPC ARCHITECTURE: Use fallthrough; Joe Perches
@ 2020-03-11  4:51 ` Joe Perches
  2020-03-11  6:47   ` Jürgen Groß
  1 sibling, 1 reply; 5+ messages in thread
From: Joe Perches @ 2020-03-11  4:51 UTC (permalink / raw)
  To: Boris Ostrovsky, Juergen Gross, Stefano Stabellini,
	Konrad Rzeszutek Wilk, Roger Pau Monné, Jens Axboe,
	David S. Miller, Bjorn Helgaas, James E.J. Bottomley,
	Martin K. Petersen
  Cc: xen-devel, linux-block, linux-kernel, netdev, linux-pci,
	linux-scsi

Convert the various uses of fallthrough comments to fallthrough;

Done via script
Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe.com/

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/block/xen-blkfront.c               | 5 ++---
 drivers/net/xen-netfront.c                 | 2 +-
 drivers/pci/xen-pcifront.c                 | 2 +-
 drivers/scsi/xen-scsifront.c               | 2 +-
 drivers/xen/pvcalls-front.c                | 2 +-
 drivers/xen/xen-acpi-memhotplug.c          | 2 +-
 drivers/xen/xen-pciback/xenbus.c           | 2 +-
 drivers/xen/xen-scsiback.c                 | 2 +-
 drivers/xen/xenbus/xenbus_probe_frontend.c | 6 ++----
 9 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 9df516..fb07ee1 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -1402,7 +1402,6 @@ static enum blk_req_status blkif_rsp_to_req_status(int rsp)
 	case BLKIF_RSP_EOPNOTSUPP:
 		return REQ_EOPNOTSUPP;
 	case BLKIF_RSP_ERROR:
-		/* Fallthrough. */
 	default:
 		return REQ_ERROR;
 	}
@@ -1642,7 +1641,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
 				info->feature_flush = 0;
 				xlvbd_flush(info);
 			}
-			/* fall through */
+			fallthrough;
 		case BLKIF_OP_READ:
 		case BLKIF_OP_WRITE:
 			if (unlikely(bret->status != BLKIF_RSP_OKAY))
@@ -2480,7 +2479,7 @@ static void blkback_changed(struct xenbus_device *dev,
 	case XenbusStateClosed:
 		if (dev->state == XenbusStateClosed)
 			break;
-		/* fall through */
+		fallthrough;
 	case XenbusStateClosing:
 		if (info)
 			blkfront_closing(info);
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 482c6c..2001606 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -2038,7 +2038,7 @@ static void netback_changed(struct xenbus_device *dev,
 	case XenbusStateClosed:
 		if (dev->state == XenbusStateClosed)
 			break;
-		/* Fall through - Missed the backend's CLOSING state. */
+		fallthrough;	/* Missed the backend's CLOSING state */
 	case XenbusStateClosing:
 		xenbus_frontend_closed(dev);
 		break;
diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index d1b16c..093ab8 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -1103,7 +1103,7 @@ static void __ref pcifront_backend_changed(struct xenbus_device *xdev,
 	case XenbusStateClosed:
 		if (xdev->state == XenbusStateClosed)
 			break;
-		/* fall through - Missed the backend's CLOSING state. */
+		fallthrough;	/* Missed the backend's CLOSING state */
 	case XenbusStateClosing:
 		dev_warn(&xdev->dev, "backend going away!\n");
 		pcifront_try_disconnect(pdev);
diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c
index f0068e..259fc248 100644
--- a/drivers/scsi/xen-scsifront.c
+++ b/drivers/scsi/xen-scsifront.c
@@ -1111,7 +1111,7 @@ static void scsifront_backend_changed(struct xenbus_device *dev,
 	case XenbusStateClosed:
 		if (dev->state == XenbusStateClosed)
 			break;
-		/* fall through - Missed the backend's Closing state */
+		fallthrough;	/* Missed the backend's Closing state */
 	case XenbusStateClosing:
 		scsifront_disconnect(info);
 		break;
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
index 57592a6..0fccf0 100644
--- a/drivers/xen/pvcalls-front.c
+++ b/drivers/xen/pvcalls-front.c
@@ -1260,7 +1260,7 @@ static void pvcalls_front_changed(struct xenbus_device *dev,
 		if (dev->state == XenbusStateClosed)
 			break;
 		/* Missed the backend's CLOSING state */
-		/* fall through */
+		fallthrough;
 	case XenbusStateClosing:
 		xenbus_frontend_closed(dev);
 		break;
diff --git a/drivers/xen/xen-acpi-memhotplug.c b/drivers/xen/xen-acpi-memhotplug.c
index 745721..f914b72 100644
--- a/drivers/xen/xen-acpi-memhotplug.c
+++ b/drivers/xen/xen-acpi-memhotplug.c
@@ -229,7 +229,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
 	case ACPI_NOTIFY_BUS_CHECK:
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 			"\nReceived BUS CHECK notification for device\n"));
-		/* Fall Through */
+		fallthrough;
 	case ACPI_NOTIFY_DEVICE_CHECK:
 		if (event == ACPI_NOTIFY_DEVICE_CHECK)
 			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
diff --git a/drivers/xen/xen-pciback/xenbus.c b/drivers/xen/xen-pciback/xenbus.c
index 833b2d..a108740 100644
--- a/drivers/xen/xen-pciback/xenbus.c
+++ b/drivers/xen/xen-pciback/xenbus.c
@@ -544,7 +544,7 @@ static void xen_pcibk_frontend_changed(struct xenbus_device *xdev,
 		xenbus_switch_state(xdev, XenbusStateClosed);
 		if (xenbus_dev_is_online(xdev))
 			break;
-		/* fall through - if not online */
+		fallthrough;	/* if not online */
 	case XenbusStateUnknown:
 		dev_dbg(&xdev->dev, "frontend is gone! unregister device\n");
 		device_unregister(&xdev->dev);
diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
index ba0942e..9daef2 100644
--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
@@ -1184,7 +1184,7 @@ static void scsiback_frontend_changed(struct xenbus_device *dev,
 		xenbus_switch_state(dev, XenbusStateClosed);
 		if (xenbus_dev_is_online(dev))
 			break;
-		/* fall through - if not online */
+		fallthrough;	/* if not online */
 	case XenbusStateUnknown:
 		device_unregister(&dev->dev);
 		break;
diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c
index 8a1650..708917 100644
--- a/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ b/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -402,13 +402,11 @@ static void xenbus_reset_frontend(char *fe, char *be, int be_state)
 	case XenbusStateConnected:
 		xenbus_printf(XBT_NIL, fe, "state", "%d", XenbusStateClosing);
 		xenbus_reset_wait_for_backend(be, XenbusStateClosing);
-		/* fall through */
-
+		fallthrough;
 	case XenbusStateClosing:
 		xenbus_printf(XBT_NIL, fe, "state", "%d", XenbusStateClosed);
 		xenbus_reset_wait_for_backend(be, XenbusStateClosed);
-		/* fall through */
-
+		fallthrough;
 	case XenbusStateClosed:
 		xenbus_printf(XBT_NIL, fe, "state", "%d", XenbusStateInitialising);
 		xenbus_reset_wait_for_backend(be, XenbusStateInitWait);
-- 
2.24.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next 020/491] XEN HYPERVISOR INTERFACE: Use fallthrough;
  2020-03-11  4:51 ` [PATCH -next 020/491] XEN HYPERVISOR INTERFACE: " Joe Perches
@ 2020-03-11  6:47   ` Jürgen Groß
  0 siblings, 0 replies; 5+ messages in thread
From: Jürgen Groß @ 2020-03-11  6:47 UTC (permalink / raw)
  To: Joe Perches, Boris Ostrovsky, Stefano Stabellini,
	Konrad Rzeszutek Wilk, Roger Pau Monné, Jens Axboe,
	David S. Miller, Bjorn Helgaas, James E.J. Bottomley,
	Martin K. Petersen
  Cc: xen-devel, linux-block, linux-kernel, netdev, linux-pci,
	linux-scsi

On 11.03.20 05:51, Joe Perches wrote:
> Convert the various uses of fallthrough comments to fallthrough;
> 
> Done via script
> Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe.com/
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next 006/491] ARM/RISCPC ARCHITECTURE: Use fallthrough;
  2020-03-11  4:51 ` [PATCH -next 006/491] ARM/RISCPC ARCHITECTURE: Use fallthrough; Joe Perches
@ 2020-03-12 10:11   ` Russell King - ARM Linux admin
  2020-03-12 10:19     ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux admin @ 2020-03-12 10:11 UTC (permalink / raw)
  To: Joe Perches
  Cc: James E.J. Bottomley, Martin K. Petersen, linux-arm-kernel,
	linux-kernel, linux-scsi

On Tue, Mar 10, 2020 at 09:51:20PM -0700, Joe Perches wrote:
> Convert the various uses of fallthrough comments to fallthrough;

And the point of what on the face of it seems to be useless churn is?

What compilers support this?

I'd check the gcc manual, but debian doesn't provide it.

> 
> Done via script
> Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe.com/
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  arch/arm/mach-rpc/riscpc.c |  2 +-
>  drivers/scsi/arm/fas216.c  | 17 ++++++-----------
>  2 files changed, 7 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
> index ea2c842..d23970b 100644
> --- a/arch/arm/mach-rpc/riscpc.c
> +++ b/arch/arm/mach-rpc/riscpc.c
> @@ -46,7 +46,7 @@ static int __init parse_tag_acorn(const struct tag *tag)
>  	switch (tag->u.acorn.vram_pages) {
>  	case 512:
>  		vram_size += PAGE_SIZE * 256;
> -		/* Fall through - ??? */
> +		fallthrough;	/* ??? */
>  	case 256:
>  		vram_size += PAGE_SIZE * 256;
>  	default:
> diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
> index 6c68c230..bb18be 100644
> --- a/drivers/scsi/arm/fas216.c
> +++ b/drivers/scsi/arm/fas216.c
> @@ -603,8 +603,7 @@ static void fas216_handlesync(FAS216_Info *info, char *msg)
>  		msgqueue_flush(&info->scsi.msgs);
>  		msgqueue_addmsg(&info->scsi.msgs, 1, MESSAGE_REJECT);
>  		info->scsi.phase = PHASE_MSGOUT_EXPECT;
> -		/* fall through */
> -
> +		fallthrough;
>  	case async:
>  		dev->period = info->ifcfg.asyncperiod / 4;
>  		dev->sof    = 0;
> @@ -916,8 +915,7 @@ static void fas216_disconnect_intr(FAS216_Info *info)
>  			fas216_done(info, DID_ABORT);
>  			break;
>  		}
> -		/* else, fall through */
> -
> +		fallthrough;
>  	default:				/* huh?					*/
>  		printk(KERN_ERR "scsi%d.%c: unexpected disconnect in phase %s\n",
>  			info->host->host_no, fas216_target(info), fas216_drv_phase(info));
> @@ -1413,8 +1411,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne
>  	case STATE(STAT_STATUS, PHASE_DATAOUT): /* Data Out     -> Status       */
>  	case STATE(STAT_STATUS, PHASE_DATAIN):  /* Data In      -> Status       */
>  		fas216_stoptransfer(info);
> -		/* fall through */
> -
> +		fallthrough;
>  	case STATE(STAT_STATUS, PHASE_SELSTEPS):/* Sel w/ steps -> Status       */
>  	case STATE(STAT_STATUS, PHASE_MSGOUT):  /* Message Out  -> Status       */
>  	case STATE(STAT_STATUS, PHASE_COMMAND): /* Command      -> Status       */
> @@ -1426,8 +1423,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne
>  	case STATE(STAT_MESGIN, PHASE_DATAOUT): /* Data Out     -> Message In   */
>  	case STATE(STAT_MESGIN, PHASE_DATAIN):  /* Data In      -> Message In   */
>  		fas216_stoptransfer(info);
> -		/* fall through */
> -
> +		fallthrough;
>  	case STATE(STAT_MESGIN, PHASE_COMMAND):	/* Command	-> Message In	*/
>  	case STATE(STAT_MESGIN, PHASE_SELSTEPS):/* Sel w/ steps -> Message In   */
>  	case STATE(STAT_MESGIN, PHASE_MSGOUT):  /* Message Out  -> Message In   */
> @@ -1581,8 +1577,7 @@ static void fas216_funcdone_intr(FAS216_Info *info, unsigned int stat, unsigned
>  			fas216_message(info);
>  			break;
>  		}
> -		/* else, fall through */
> -
> +		fallthrough;
>  	default:
>  		fas216_log(info, 0, "internal phase %s for function done?"
>  			"  What do I do with this?",
> @@ -1964,7 +1959,7 @@ static void fas216_kick(FAS216_Info *info)
>  	switch (where_from) {
>  	case TYPE_QUEUE:
>  		fas216_allocate_tag(info, SCpnt);
> -		/* fall through */
> +		fallthrough;
>  	case TYPE_OTHER:
>  		fas216_start_command(info, SCpnt);
>  		break;
> -- 
> 2.24.0
> 
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next 006/491] ARM/RISCPC ARCHITECTURE: Use fallthrough;
  2020-03-12 10:11   ` Russell King - ARM Linux admin
@ 2020-03-12 10:19     ` Joe Perches
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2020-03-12 10:19 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: James E.J. Bottomley, Martin K. Petersen, linux-arm-kernel,
	linux-kernel, linux-scsi

On Thu, 2020-03-12 at 10:11 +0000, Russell King - ARM Linux admin wrote:
> On Tue, Mar 10, 2020 at 09:51:20PM -0700, Joe Perches wrote:
> > Convert the various uses of fallthrough comments to fallthrough;
> 
> And the point of what on the face of it seems to be useless churn is?
> 
> What compilers support this?

gcc 7.1, clang 9

clang does not support the /* fallthrough */ comment styles.

clang does support the __attribute__((__fallthrough__))
and the c++17 [[fallthrough]] weirdness.

see:

commit 294f69e662d1 ("compiler_attributes.h: Add 'fallthrough' pseudo
keyword for switch/case use")


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-12 10:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1583896344.git.joe@perches.com>
2020-03-11  4:51 ` [PATCH -next 006/491] ARM/RISCPC ARCHITECTURE: Use fallthrough; Joe Perches
2020-03-12 10:11   ` Russell King - ARM Linux admin
2020-03-12 10:19     ` Joe Perches
2020-03-11  4:51 ` [PATCH -next 020/491] XEN HYPERVISOR INTERFACE: " Joe Perches
2020-03-11  6:47   ` Jürgen Groß

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).