Skip to content

Commit

Permalink
Merge tag 'Wimplicit-fallthrough-5.3-rc4' of git://git.kernel.org/pub…
Browse files Browse the repository at this point in the history
…/scm/linux/kernel/git/gustavoars/linux

Pull fall-through fixes from Gustavo A. R. Silva:
 "Mark more switch cases where we are expecting to fall through, fixing
  fall-through warnings in arm, sparc64, mips, i386 and s390"

* tag 'Wimplicit-fallthrough-5.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux:
  ARM: ep93xx: Mark expected switch fall-through
  scsi: fas216: Mark expected switch fall-throughs
  pcmcia: db1xxx_ss: Mark expected switch fall-throughs
  video: fbdev: omapfb_main: Mark expected switch fall-throughs
  watchdog: riowd: Mark expected switch fall-through
  s390/net: Mark expected switch fall-throughs
  crypto: ux500/crypt: Mark expected switch fall-throughs
  watchdog: wdt977: Mark expected switch fall-through
  watchdog: scx200_wdt: Mark expected switch fall-through
  watchdog: Mark expected switch fall-throughs
  ARM: signal: Mark expected switch fall-through
  mfd: omap-usb-host: Mark expected switch fall-throughs
  mfd: db8500-prcmu: Mark expected switch fall-throughs
  ARM: OMAP: dma: Mark expected switch fall-throughs
  ARM: alignment: Mark expected switch fall-throughs
  ARM: tegra: Mark expected switch fall-through
  ARM/hw_breakpoint: Mark expected switch fall-throughs
  • Loading branch information
torvalds committed Aug 10, 2019
2 parents 451577f + 1f7585f commit bf1881c
Show file tree
Hide file tree
Showing 22 changed files with 58 additions and 18 deletions.
5 changes: 5 additions & 0 deletions arch/arm/kernel/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ static int arch_build_bp_info(struct perf_event *bp,
if ((hw->ctrl.type != ARM_BREAKPOINT_EXECUTE)
&& max_watchpoint_len >= 8)
break;
/* Else, fall through */
default:
return -EINVAL;
}
Expand Down Expand Up @@ -608,10 +609,12 @@ int hw_breakpoint_arch_parse(struct perf_event *bp,
/* Allow halfword watchpoints and breakpoints. */
if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2)
break;
/* Else, fall through */
case 3:
/* Allow single byte watchpoint. */
if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1)
break;
/* Else, fall through */
default:
ret = -EINVAL;
goto out;
Expand Down Expand Up @@ -861,6 +864,7 @@ static int hw_breakpoint_pending(unsigned long addr, unsigned int fsr,
break;
case ARM_ENTRY_ASYNC_WATCHPOINT:
WARN(1, "Asynchronous watchpoint exception taken. Debugging results may be unreliable\n");
/* Fall through */
case ARM_ENTRY_SYNC_WATCHPOINT:
watchpoint_handler(addr, fsr, regs);
break;
Expand Down Expand Up @@ -909,6 +913,7 @@ static bool core_has_os_save_restore(void)
ARM_DBG_READ(c1, c1, 4, oslsr);
if (oslsr & ARM_OSLSR_OSLM0)
return true;
/* Else, fall through */
default:
return false;
}
Expand Down
1 change: 1 addition & 0 deletions arch/arm/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ static int do_signal(struct pt_regs *regs, int syscall)
switch (retval) {
case -ERESTART_RESTARTBLOCK:
restart -= 2;
/* Fall through */
case -ERESTARTNOHAND:
case -ERESTARTSYS:
case -ERESTARTNOINTR:
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-ep93xx/crunch.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ static int crunch_do(struct notifier_block *self, unsigned long cmd, void *t)
* FALLTHROUGH: Ensure we don't try to overwrite our newly
* initialised state information on the first fault.
*/
/* Fall through */

case THREAD_NOTIFY_EXIT:
crunch_task_release(thread);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-tegra/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static void __init tegra_cpu_reset_handler_enable(void)
switch (err) {
case -ENOSYS:
tegra_cpu_reset_handler_set(reset_address);
/* pass-through */
/* fall through */
case 0:
is_enabled = true;
break;
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mm/alignment.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ thumb2arm(u16 tinstr)
return subset[(L<<1) | ((tinstr & (1<<8)) >> 8)] |
(tinstr & 255); /* register_list */
}
/* Else fall through for illegal instruction case */
/* Else, fall through - for illegal instruction case */

default:
return BAD_INSTR;
Expand Down Expand Up @@ -751,6 +751,8 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs,
case 0xe8e0:
case 0xe9e0:
poffset->un = (tinst2 & 0xff) << 2;
/* Fall through */

case 0xe940:
case 0xe9c0:
return do_alignment_ldrdstrd;
Expand Down
14 changes: 5 additions & 9 deletions arch/arm/plat-omap/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,17 +388,15 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
/*
* not supported by current hardware on OMAP1
* w |= (0x03 << 7);
* fall through
*/
/* fall through */
case OMAP_DMA_DATA_BURST_16:
if (dma_omap2plus()) {
burst = 0x3;
break;
}
/*
* OMAP1 don't support burst 16
* fall through
*/
/* OMAP1 don't support burst 16 */
/* fall through */
default:
BUG();
}
Expand Down Expand Up @@ -474,10 +472,8 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
burst = 0x3;
break;
}
/*
* OMAP1 don't support burst 16
* fall through
*/
/* OMAP1 don't support burst 16 */
/* fall through */
default:
printk(KERN_ERR "Invalid DMA burst mode\n");
BUG();
Expand Down
6 changes: 6 additions & 0 deletions drivers/crypto/ux500/cryp/cryp.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,17 @@ void cryp_save_device_context(struct cryp_device_data *device_data,
case CRYP_KEY_SIZE_256:
ctx->key_4_l = readl_relaxed(&src_reg->key_4_l);
ctx->key_4_r = readl_relaxed(&src_reg->key_4_r);
/* Fall through */

case CRYP_KEY_SIZE_192:
ctx->key_3_l = readl_relaxed(&src_reg->key_3_l);
ctx->key_3_r = readl_relaxed(&src_reg->key_3_r);
/* Fall through */

case CRYP_KEY_SIZE_128:
ctx->key_2_l = readl_relaxed(&src_reg->key_2_l);
ctx->key_2_r = readl_relaxed(&src_reg->key_2_r);
/* Fall through */

default:
ctx->key_1_l = readl_relaxed(&src_reg->key_1_l);
Expand Down Expand Up @@ -361,14 +364,17 @@ void cryp_restore_device_context(struct cryp_device_data *device_data,
case CRYP_KEY_SIZE_256:
writel_relaxed(ctx->key_4_l, &reg->key_4_l);
writel_relaxed(ctx->key_4_r, &reg->key_4_r);
/* Fall through */

case CRYP_KEY_SIZE_192:
writel_relaxed(ctx->key_3_l, &reg->key_3_l);
writel_relaxed(ctx->key_3_r, &reg->key_3_r);
/* Fall through */

case CRYP_KEY_SIZE_128:
writel_relaxed(ctx->key_2_l, &reg->key_2_l);
writel_relaxed(ctx->key_2_r, &reg->key_2_r);
/* Fall through */

default:
writel_relaxed(ctx->key_1_l, &reg->key_1_l);
Expand Down
2 changes: 2 additions & 0 deletions drivers/mfd/db8500-prcmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1590,8 +1590,10 @@ static unsigned long dsiclk_rate(u8 n)
switch (divsel) {
case PRCM_DSI_PLLOUT_SEL_PHI_4:
div *= 2;
/* Fall through */
case PRCM_DSI_PLLOUT_SEL_PHI_2:
div *= 2;
/* Fall through */
case PRCM_DSI_PLLOUT_SEL_PHI:
return pll_rate(PRCM_PLLDSI_FREQ, clock_rate(PRCMU_HDMICLK),
PLL_RAW) / div;
Expand Down
4 changes: 2 additions & 2 deletions drivers/mfd/omap-usb-host.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ static int usbhs_runtime_resume(struct device *dev)
i, r);
}
}
/* Fall through as HSIC mode needs utmi_clk */
/* Fall through - as HSIC mode needs utmi_clk */

case OMAP_EHCI_PORT_MODE_TLL:
if (!IS_ERR(omap->utmi_clk[i])) {
Expand Down Expand Up @@ -344,7 +344,7 @@ static int usbhs_runtime_suspend(struct device *dev)

if (!IS_ERR(omap->hsic480m_clk[i]))
clk_disable_unprepare(omap->hsic480m_clk[i]);
/* Fall through as utmi_clks were used in HSIC mode */
/* Fall through - as utmi_clks were used in HSIC mode */

case OMAP_EHCI_PORT_MODE_TLL:
if (!IS_ERR(omap->utmi_clk[i]))
Expand Down
4 changes: 4 additions & 0 deletions drivers/pcmcia/db1xxx_ss.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@ static int db1x_pcmcia_configure(struct pcmcia_socket *skt,
switch (state->Vcc) {
case 50:
++v;
/* fall through */
case 33:
++v;
/* fall through */
case 0:
break;
default:
Expand All @@ -267,9 +269,11 @@ static int db1x_pcmcia_configure(struct pcmcia_socket *skt,
switch (state->Vpp) {
case 12:
++p;
/* fall through */
case 33:
case 50:
++p;
/* fall through */
case 0:
break;
default:
Expand Down
1 change: 1 addition & 0 deletions drivers/s390/net/ctcm_fsms.c
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,7 @@ static void ctcmpc_chx_attnbusy(fsm_instance *fsm, int event, void *arg)
grp->changed_side = 2;
break;
}
/* Else, fall through */
case MPCG_STATE_XID0IOWAIX:
case MPCG_STATE_XID7INITW:
case MPCG_STATE_XID7INITX:
Expand Down
3 changes: 3 additions & 0 deletions drivers/s390/net/ctcm_mpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ int ctc_mpc_alloc_channel(int port_num, void (*callback)(int, int))
/*fsm_newstate(grp->fsm, MPCG_STATE_XID2INITW);*/
if (callback)
grp->send_qllc_disc = 1;
/* Else, fall through */
case MPCG_STATE_XID0IOWAIT:
fsm_deltimer(&grp->timer);
grp->outstanding_xid2 = 0;
Expand Down Expand Up @@ -1469,6 +1470,7 @@ static void mpc_action_timeout(fsm_instance *fi, int event, void *arg)
if ((fsm_getstate(rch->fsm) == CH_XID0_PENDING) &&
(fsm_getstate(wch->fsm) == CH_XID0_PENDING))
break;
/* Else, fall through */
default:
fsm_event(grp->fsm, MPCG_EVENT_INOP, dev);
}
Expand Down Expand Up @@ -2089,6 +2091,7 @@ static int mpc_send_qllc_discontact(struct net_device *dev)
grp->estconnfunc = NULL;
break;
}
/* Else, fall through */
case MPCG_STATE_FLOWC:
case MPCG_STATE_READY:
grp->send_qllc_disc = 2;
Expand Down
2 changes: 1 addition & 1 deletion drivers/s390/net/qeth_l2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ static int qeth_l2_process_inbound_buffer(struct qeth_card *card,
card->osn_info.data_cb(skb);
break;
}
/* else unknown */
/* Else, fall through */
default:
dev_kfree_skb_any(skb);
QETH_CARD_TEXT(card, 3, "inbunkno");
Expand Down
8 changes: 8 additions & 0 deletions drivers/scsi/arm/fas216.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +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 */

case async:
dev->period = info->ifcfg.asyncperiod / 4;
Expand Down Expand Up @@ -915,6 +916,7 @@ static void fas216_disconnect_intr(FAS216_Info *info)
fas216_done(info, DID_ABORT);
break;
}
/* else, fall through */

default: /* huh? */
printk(KERN_ERR "scsi%d.%c: unexpected disconnect in phase %s\n",
Expand Down Expand Up @@ -1411,6 +1413,8 @@ 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 */

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 */
Expand All @@ -1422,6 +1426,8 @@ 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 */

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 */
Expand Down Expand Up @@ -1575,6 +1581,7 @@ static void fas216_funcdone_intr(FAS216_Info *info, unsigned int stat, unsigned
fas216_message(info);
break;
}
/* else, fall through */

default:
fas216_log(info, 0, "internal phase %s for function done?"
Expand Down Expand Up @@ -1957,6 +1964,7 @@ static void fas216_kick(FAS216_Info *info)
switch (where_from) {
case TYPE_QUEUE:
fas216_allocate_tag(info, SCpnt);
/* fall through */
case TYPE_OTHER:
fas216_start_command(info, SCpnt);
break;
Expand Down
8 changes: 8 additions & 0 deletions drivers/video/fbdev/omap/omapfb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ static int set_color_mode(struct omapfb_plane_struct *plane,
return 0;
case 12:
var->bits_per_pixel = 16;
/* fall through */
case 16:
if (plane->fbdev->panel->bpp == 12)
plane->color_mode = OMAPFB_COLOR_RGB444;
Expand Down Expand Up @@ -1534,20 +1535,27 @@ static void omapfb_free_resources(struct omapfb_device *fbdev, int state)
case OMAPFB_ACTIVE:
for (i = 0; i < fbdev->mem_desc.region_cnt; i++)
unregister_framebuffer(fbdev->fb_info[i]);
/* fall through */
case 7:
omapfb_unregister_sysfs(fbdev);
/* fall through */
case 6:
if (fbdev->panel->disable)
fbdev->panel->disable(fbdev->panel);
/* fall through */
case 5:
omapfb_set_update_mode(fbdev, OMAPFB_UPDATE_DISABLED);
/* fall through */
case 4:
planes_cleanup(fbdev);
/* fall through */
case 3:
ctrl_cleanup(fbdev);
/* fall through */
case 2:
if (fbdev->panel->cleanup)
fbdev->panel->cleanup(fbdev->panel);
/* fall through */
case 1:
dev_set_drvdata(fbdev->dev, NULL);
kfree(fbdev);
Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/ar7_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ static long ar7_wdt_ioctl(struct file *file,
ar7_wdt_update_margin(new_margin);
ar7_wdt_kick(1);
spin_unlock(&wdt_lock);
/* Fall through */

case WDIOC_GETTIMEOUT:
if (put_user(margin, (int *)arg))
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/pcwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ static long pcwd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return -EINVAL;

pcwd_keepalive();
/* Fall */
/* Fall through */

case WDIOC_GETTIMEOUT:
return put_user(heartbeat, argp);
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/riowd.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static long riowd_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
return -EINVAL;
riowd_timeout = (new_margin + 59) / 60;
riowd_writereg(p, riowd_timeout, WDTO_INDEX);
/* Fall */
/* Fall through */

case WDIOC_GETTIMEOUT:
return put_user(riowd_timeout * 60, (int __user *)argp);
Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/sb_wdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ static long sbwdog_ioctl(struct file *file, unsigned int cmd,
timeout = time;
sbwdog_set(user_dog, timeout);
sbwdog_pet(user_dog);
/* Fall through */

case WDIOC_GETTIMEOUT:
/*
Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/scx200_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ static long scx200_wdt_ioctl(struct file *file, unsigned int cmd,
margin = new_margin;
scx200_wdt_update_margin();
scx200_wdt_ping();
/* Fall through */
case WDIOC_GETTIMEOUT:
if (put_user(margin, p))
return -EFAULT;
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (wdt_set_heartbeat(new_heartbeat))
return -EINVAL;
wdt_ping();
/* Fall */
/* Fall through */
case WDIOC_GETTIMEOUT:
return put_user(heartbeat, p);
default:
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/wdt977.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ static long wdt977_ioctl(struct file *file, unsigned int cmd,
return -EINVAL;

wdt977_keepalive();
/* Fall */
/* Fall through */

case WDIOC_GETTIMEOUT:
return put_user(timeout, uarg.i);
Expand Down

0 comments on commit bf1881c

Please sign in to comment.