[GIT PULL] fallthrough fixes for Clang for 5.14-rc2

Gustavo A. R. Silva
2021-07-14T20:04:49Z

The following changes since commit e73f0f0ee7541171d89f2e2491130c7771ba58d3:

Linux 5.14-rc1 (2021-07-11 15:07:40 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git tags/Wimplicit-fallthrough-clang-5.14-rc2

for you to fetch changes up to b7eb335e26a9c7f258c96b3962c283c379d3ede0:

Makefile: Enable -Wimplicit-fallthrough for Clang (2021-07-14 11:12:21 -0500)

----------------------------------------------------------------
fallthrough fixes for Clang for 5.14-rc2

Hi Linus,

Please, pull the following patches that fix many fall-through
warnings when building with Clang and -Wimplicit-fallthrough.

This pull-request also contains the patch for Makefile that enables
-Wimplicit-fallthrough for Clang, globally.

It's also important to notice that since we have adopted the use of
the pseudo-keyword macro fallthrough; we also want to avoid having
more /* fall through */ comments being introduced. Notice that contrary
to GCC, Clang doesn't recognize any comments as implicit fall-through
markings when the -Wimplicit-fallthrough option is enabled. So, in
order to avoid having more comments being introduced, we have to use
the option -Wimplicit-fallthrough=5 for GCC, which similar to Clang,
will cause a warning in case a code comment is intended to be used
as a fall-through marking. The patch for Makefile also enforces this.

We had almost 4,000 of these issues for Clang in the beginning,
and there might be a couple more out there when building some
architectures with certain configurations. However, with the
recent fixes I think we are in good shape and it is now possible
to enable -Wimplicit-fallthrough for Clang. :)

Thanks!

----------------------------------------------------------------
Gustavo A. R. Silva (27):
xfs: Fix multiple fall-through warnings for Clang
mt76: mt7921: Fix fall-through warning for Clang
nfp: flower-ct: Fix fall-through warning for Clang
drm/i915: Fix fall-through warning for Clang
kernel: debug: Fix unreachable code in gdb_serial_stub()
fcntl: Fix unreachable code in do_fcntl()
mtd: cfi_util: Fix unreachable code issue
drm/msm: Fix fall-through warning in msm_gem_new_impl()
cpufreq: Fix fall-through warning for Clang
math-emu: Fix fall-through warning
video: fbdev: Fix fall-through warning for Clang
scsi: libsas: Fix fall-through warning for Clang
PCI: Fix fall-through warning for Clang
mmc: jz4740: Fix fall-through warning for Clang
iommu/arm-smmu-v3: Fix fall-through warning for Clang
dmaengine: ipu: Fix fall-through warning for Clang
s390: Fix fall-through warnings for Clang
dmaengine: ti: k3-udma: Fix fall-through warning for Clang
power: supply: Fix fall-through warnings for Clang
ASoC: Mediatek: MT8183: Fix fall-through warning for Clang
MIPS: Fix fall-through warnings for Clang
MIPS: Fix unreachable code issue
powerpc/powernv: Fix fall-through warning for Clang
usb: gadget: fsl_qe_udc: Fix fall-through warning for Clang
dmaengine: mpc512x: Fix fall-through warning for Clang
powerpc/smp: Fix fall-through warning for Clang
Makefile: Enable -Wimplicit-fallthrough for Clang

Makefile | 9 +++------
arch/mips/include/asm/fpu.h | 2 +-
arch/mips/mm/tlbex.c | 2 ++
arch/powerpc/platforms/powermac/smp.c | 1 +
arch/s390/kernel/uprobes.c | 1 +
drivers/char/powernv-op-panel.c | 1 +
drivers/cpufreq/longhaul.c | 2 --
drivers/dma/ipu/ipu_idmac.c | 2 ++
drivers/dma/mpc512x_dma.c | 1 +
drivers/dma/ti/k3-udma.c | 1 +
drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 1 +
drivers/gpu/drm/msm/msm_gem.c | 2 +-
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 +
drivers/mmc/host/jz4740_mmc.c | 2 ++
drivers/mtd/chips/cfi_util.c | 4 ++--
drivers/net/ethernet/netronome/nfp/flower/conntrack.c | 1 +
drivers/net/wireless/mediatek/mt76/mt7921/main.c | 1 +
drivers/pci/proc.c | 2 +-
drivers/power/supply/ab8500_fg.c | 2 ++
drivers/power/supply/abx500_chargalg.c | 1 +
drivers/s390/char/tape_char.c | 2 --
drivers/s390/net/ctcm_fsms.c | 1 +
drivers/s390/net/qeth_l3_main.c | 1 +
drivers/scsi/libsas/sas_discover.c | 2 +-
drivers/usb/gadget/udc/fsl_qe_udc.c | 1 +
drivers/video/fbdev/xilinxfb.c | 2 ++
fs/fcntl.c | 2 +-
fs/xfs/libxfs/xfs_attr.c | 16 ++++++++--------
include/math-emu/op-common.h | 2 +-
kernel/debug/gdbstub.c | 2 +-
sound/soc/mediatek/mt8183/mt8183-dai-adda.c | 1 +
31 files changed, 44 insertions(+), 27 deletions(-)