ata: mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

In cases where a "drop through" comment was already in place, I replaced
it  with a proper "fall through" comment, which is what GCC is expecting
to find.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
Gustavo A. R. Silva 2017-10-12 14:19:16 -05:00 committed by Tejun Heo
parent 14d7045c7f
commit 05b8360599
5 changed files with 10 additions and 2 deletions

View File

@ -295,6 +295,7 @@ static int ahci_platform_get_phy(struct ahci_host_priv *hpriv, u32 port,
node->name); node->name);
break; break;
} }
/* fall through */
case -ENODEV: case -ENODEV:
/* continue normally */ /* continue normally */
hpriv->phys[port] = NULL; hpriv->phys[port] = NULL;

View File

@ -1879,6 +1879,7 @@ retry:
switch (class) { switch (class) {
case ATA_DEV_SEMB: case ATA_DEV_SEMB:
class = ATA_DEV_ATA; /* some hard drives report SEMB sig */ class = ATA_DEV_ATA; /* some hard drives report SEMB sig */
/* fall through */
case ATA_DEV_ATA: case ATA_DEV_ATA:
case ATA_DEV_ZAC: case ATA_DEV_ZAC:
tf.command = ATA_CMD_ID_ATA; tf.command = ATA_CMD_ID_ATA;
@ -2975,6 +2976,7 @@ int ata_bus_probe(struct ata_port *ap)
case -ENODEV: case -ENODEV:
/* give it just one more chance */ /* give it just one more chance */
tries[dev->devno] = min(tries[dev->devno], 1); tries[dev->devno] = min(tries[dev->devno], 1);
/* fall through */
case -EIO: case -EIO:
if (tries[dev->devno] == 1) { if (tries[dev->devno] == 1) {
/* This is the last chance, better to slow /* This is the last chance, better to slow
@ -3462,6 +3464,7 @@ int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel)
case ATA_DNXFER_FORCE_PIO0: case ATA_DNXFER_FORCE_PIO0:
pio_mask &= 1; pio_mask &= 1;
/* fall through */
case ATA_DNXFER_FORCE_PIO: case ATA_DNXFER_FORCE_PIO:
mwdma_mask = 0; mwdma_mask = 0;
udma_mask = 0; udma_mask = 0;

View File

@ -3711,9 +3711,11 @@ static int ata_eh_handle_dev_fail(struct ata_device *dev, int err)
case -ENODEV: case -ENODEV:
/* device missing or wrong IDENTIFY data, schedule probing */ /* device missing or wrong IDENTIFY data, schedule probing */
ehc->i.probe_mask |= (1 << dev->devno); ehc->i.probe_mask |= (1 << dev->devno);
/* fall through */
case -EINVAL: case -EINVAL:
/* give it just one more chance */ /* give it just one more chance */
ehc->tries[dev->devno] = min(ehc->tries[dev->devno], 1); ehc->tries[dev->devno] = min(ehc->tries[dev->devno], 1);
/* fall through */
case -EIO: case -EIO:
if (ehc->tries[dev->devno] == 1) { if (ehc->tries[dev->devno] == 1) {
/* This is the last chance, better to slow /* This is the last chance, better to slow

View File

@ -171,6 +171,7 @@ static int atp867x_get_active_clocks_shifted(struct ata_port *ap,
default: default:
printk(KERN_WARNING "ATP867X: active %dclk is invalid. " printk(KERN_WARNING "ATP867X: active %dclk is invalid. "
"Using 12clk.\n", clk); "Using 12clk.\n", clk);
/* fall through */
case 9 ... 12: case 9 ... 12:
clocks = 7; /* 12 clk */ clocks = 7; /* 12 clk */
break; break;
@ -203,6 +204,7 @@ static int atp867x_get_recover_clocks_shifted(unsigned int clk)
default: default:
printk(KERN_WARNING "ATP867X: recover %dclk is invalid. " printk(KERN_WARNING "ATP867X: recover %dclk is invalid. "
"Using default 12clk.\n", clk); "Using default 12clk.\n", clk);
/* fall through */
case 12: /* default 12 clk */ case 12: /* default 12 clk */
clocks = 0; clocks = 0;
break; break;

View File

@ -2387,7 +2387,7 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc)
": attempting PIO w/multiple DRQ: " ": attempting PIO w/multiple DRQ: "
"this may fail due to h/w errata\n"); "this may fail due to h/w errata\n");
} }
/* drop through */ /* fall through */
case ATA_PROT_NODATA: case ATA_PROT_NODATA:
case ATAPI_PROT_PIO: case ATAPI_PROT_PIO:
case ATAPI_PROT_NODATA: case ATAPI_PROT_NODATA:
@ -3875,7 +3875,7 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
" and avoid the final two gigabytes on" " and avoid the final two gigabytes on"
" all RocketRAID BIOS initialized drives.\n"); " all RocketRAID BIOS initialized drives.\n");
} }
/* drop through */ /* fall through */
case chip_6042: case chip_6042:
hpriv->ops = &mv6xxx_ops; hpriv->ops = &mv6xxx_ops;
hp_flags |= MV_HP_GEN_IIE; hp_flags |= MV_HP_GEN_IIE;