Thread (18 messages) 18 messages, 16 authors, 2020-09-17

Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Date: 2020-09-10 06:28:44
Also in: bpf, ceph-devel, dm-devel, dri-devel, intel-gfx, intel-wired-lan, kvmarm, linux-arm-kernel, linux-crypto, linux-fbdev, linux-i2c, linux-ide, linux-input, linux-iommu, linux-media, linux-mediatek, linux-mips, linux-mmc, linux-nfs, linux-pm, linux-rdma, linux-rtc, linux-s390, linux-scsi, linux-sctp, linux-usb, linux-wireless, linuxppc-dev, lkml, netdev, netfilter-devel, nouveau, sparclinux

Em Wed, 09 Sep 2020 13:06:39 -0700
Joe Perches [off-list ref] escreveu:
fallthrough to a separate case/default label break; isn't very readable.

Convert pseudo-keyword fallthrough; statements to a simple break; when
the next label is case or default and the only statement in the next
label block is break;

Found using:

$ grep-2.5.4 -rP --include=*.[ch] -n "fallthrough;(\s*(case\s+\w+|default)\s*:\s*){1,7}break;" *

Miscellanea:

o Move or coalesce a couple label blocks above a default: block.

Signed-off-by: Joe Perches <joe@perches.com>
---

Compiled allyesconfig x86-64 only.
A few files for other arches were not compiled.
 drivers/media/dvb-frontends/drxd_hard.c                   |  2 +-
 drivers/media/i2c/ov5640.c                                |  2 +-
 drivers/media/i2c/ov6650.c                                |  5 ++---
 drivers/media/i2c/smiapp/smiapp-core.c                    |  2 +-
 drivers/media/i2c/tvp5150.c                               |  2 +-
 drivers/media/pci/ddbridge/ddbridge-core.c                |  2 +-
 drivers/media/usb/cpia2/cpia2_core.c                      |  2 +-
For media drivers:

Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


Thanks,
Mauro
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help