Re: [PATCH -next 006/491] ARM/RISCPC ARCHITECTURE: Use fallthrough;
From: Russell King - ARM Linux admin
Date: Thu Mar 12 2020 - 06:11:49 EST
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@xxxxxxxxxxx>
> ---
> 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