Skip to contentSkip to conversation

Fix fall-through warnings for Clang

PATCH Applied Gustavo A. R. Silva 66 participants 372 messages Nov 20, 2020 – May 18, 2021 3 messages not in the archive Page 1 of 2

Subsystems (140)
lore
Share & tools
lore
#0 lore raw

cover Fix fall-through warnings for Clang

Hi all,

This series aims to fix almost all remaining fall-through warnings in order to enable -Wimplicit-fallthrough for Clang.

In preparation to enable -Wimplicit-fallthrough for Clang, explicitly add multiple break/goto/return/fallthrough statements instead of just letting the code fall through to the next case.

Notice that in order to enable -Wimplicit-fallthrough for Clang, this change[1] is meant to be reverted at some point. So, this patch helps to move in that direction.

Something important to mention is that there is currently a discrepancy between GCC and Clang when dealing with switch fall-through to empty case statements or to cases that only contain a break/continue/return statement[2][3][4].

Now that the -Wimplicit-fallthrough option has been globally enabled[5], any compiler should really warn on missing either a fallthrough annotation or any of the other case-terminating statements (break/continue/return/ goto) when falling through to the next case statement. Making exceptions to this introduces variation in case handling which may continue to lead to bugs, misunderstandings, and a general lack of robustness. The point of enabling options like -Wimplicit-fallthrough is to prevent human error and aid developers in spotting bugs before their code is even built/ submitted/committed, therefore eliminating classes of bugs. So, in order to really accomplish this, we should, and can, move in the direction of addressing any error-prone scenarios and get rid of the unintentional fallthrough bug-class in the kernel, entirely, even if there is some minor redundancy. Better to have explicit case-ending statements than continue to have exceptions where one must guess as to the right result. The compiler will eliminate any actual redundancy.

Note that there is already a patch in mainline that addresses almost 40,000 of these issues[6].

I'm happy to carry this whole series in my own tree if people are OK with it. :)

[1] commit e2079e93f562c ("kbuild: Do not enable -Wimplicit-fallthrough for clang for now")
[2] ClangBuiltLinux#636
[3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91432
[4] https://godbolt.org/z/xgkvIh
[5] commit a035d552a93b ("Makefile: Globally enable fall-through warning")
[6] commit 4169e889e588 ("include: jhash/signal: Fix fall-through warnings for Clang")

Thanks!

Gustavo A. R. Silva (141):
afs: Fix fall-through warnings for Clang
ASoC: codecs: Fix fall-through warnings for Clang
cifs: Fix fall-through warnings for Clang drm/amdgpu: Fix fall-through warnings for Clang drm/radeon: Fix fall-through warnings for Clang
gfs2: Fix fall-through warnings for Clang
gpio: Fix fall-through warnings for Clang
IB/hfi1: Fix fall-through warnings for Clang
igb: Fix fall-through warnings for Clang
ima: Fix fall-through warnings for Clang
ipv4: Fix fall-through warnings for Clang
ixgbe: Fix fall-through warnings for Clang
media: dvb-frontends: Fix fall-through warnings for Clang
media: usb: dvb-usb-v2: Fix fall-through warnings for Clang
netfilter: Fix fall-through warnings for Clang
nfsd: Fix fall-through warnings for Clang
nfs: Fix fall-through warnings for Clang
qed: Fix fall-through warnings for Clang
qlcnic: Fix fall-through warnings for Clang
scsi: aic7xxx: Fix fall-through warnings for Clang
scsi: aic94xx: Fix fall-through warnings for Clang
scsi: bfa: Fix fall-through warnings for Clang
staging: rtl8723bs: core: Fix fall-through warnings for Clang
staging: vt6655: Fix fall-through warnings for Clang
bnxt_en: Fix fall-through warnings for Clang
ceph: Fix fall-through warnings for Clang
drbd: Fix fall-through warnings for Clang drm/amd/display: Fix fall-through warnings for Clang
e1000: Fix fall-through warnings for Clang
ext2: Fix fall-through warnings for Clang
ext4: Fix fall-through warnings for Clang
floppy: Fix fall-through warnings for Clang
fm10k: Fix fall-through warnings for Clang
IB/mlx4: Fix fall-through warnings for Clang IB/qedr: Fix fall-through warnings for Clang
ice: Fix fall-through warnings for Clang
Input: pcspkr - Fix fall-through warnings for Clang
isofs: Fix fall-through warnings for Clang
ixgbevf: Fix fall-through warnings for Clang kprobes/x86: Fix fall-through warnings for Clang
mm: Fix fall-through warnings for Clang
net: 3c509: Fix fall-through warnings for Clang
net: cassini: Fix fall-through warnings for Clang net/mlx4: Fix fall-through warnings for Clang
net: mscc: ocelot: Fix fall-through warnings for Clang
netxen_nic: Fix fall-through warnings for Clang
nfp: Fix fall-through warnings for Clang
perf/x86: Fix fall-through warnings for Clang
pinctrl: Fix fall-through warnings for Clang RDMA/mlx5: Fix fall-through warnings for Clang
reiserfs: Fix fall-through warnings for Clang
security: keys: Fix fall-through warnings for Clang
selinux: Fix fall-through warnings for Clang
target: Fix fall-through warnings for Clang uprobes/x86: Fix fall-through warnings for Clang
vxge: Fix fall-through warnings for Clang
watchdog: Fix fall-through warnings for Clang
xen-blkfront: Fix fall-through warnings for Clang
regulator: as3722: Fix fall-through warnings for Clang
habanalabs: Fix fall-through warnings for Clang
tee: Fix fall-through warnings for Clang
HID: usbhid: Fix fall-through warnings for Clang
HID: input: Fix fall-through warnings for Clang
ACPI: Fix fall-through warnings for Clang
airo: Fix fall-through warnings for Clang
ALSA: hdspm: Fix fall-through warnings for Clang
ALSA: pcsp: Fix fall-through warnings for Clang
ALSA: sb: Fix fall-through warnings for Clang
ath5k: Fix fall-through warnings for Clang
atm: fore200e: Fix fall-through warnings for Clang
braille_console: Fix fall-through warnings for Clang
can: peak_usb: Fix fall-through warnings for Clang
carl9170: Fix fall-through warnings for Clang
cfg80211: Fix fall-through warnings for Clang
crypto: ccree - Fix fall-through warnings for Clang
decnet: Fix fall-through warnings for Clang
dm raid: Fix fall-through warnings for Clang drm/amd/pm: Fix fall-through warnings for Clang
drm: Fix fall-through warnings for Clang drm/i915/gem: Fix fall-through warnings for Clang drm/nouveau/clk: Fix fall-through warnings for Clang drm/nouveau: Fix fall-through warnings for Clang drm/nouveau/therm: Fix fall-through warnings for Clang drm/via: Fix fall-through warnings for Clang
firewire: core: Fix fall-through warnings for Clang
hwmon: (corsair-cpro) Fix fall-through warnings for Clang
hwmon: (max6621) Fix fall-through warnings for Clang
i3c: master: cdns: Fix fall-through warnings for Clang
ide: Fix fall-through warnings for Clang
iio: adc: cpcap: Fix fall-through warnings for Clang
iwlwifi: iwl-drv: Fix fall-through warnings for Clang
libata: Fix fall-through warnings for Clang
mac80211: Fix fall-through warnings for Clang
media: atomisp: Fix fall-through warnings for Clang
media: dvb_frontend: Fix fall-through warnings for Clang
media: rcar_jpu: Fix fall-through warnings for Clang
media: saa7134: Fix fall-through warnings for Clang
mmc: sdhci-of-arasan: Fix fall-through warnings for Clang
mt76: mt7615: Fix fall-through warnings for Clang
mtd: cfi: Fix fall-through warnings for Clang
mtd: mtdchar: Fix fall-through warnings for Clang
mtd: onenand: Fix fall-through warnings for Clang
mtd: rawnand: fsmc: Fix fall-through warnings for Clang
mtd: rawnand: stm32_fmc2: Fix fall-through warnings for Clang
net: ax25: Fix fall-through warnings for Clang
net: bridge: Fix fall-through warnings for Clang
net: core: Fix fall-through warnings for Clang
netfilter: ipt_REJECT: Fix fall-through warnings for Clang
net: netrom: Fix fall-through warnings for Clang net/packet: Fix fall-through warnings for Clang
net: plip: Fix fall-through warnings for Clang
net: rose: Fix fall-through warnings for Clang
nl80211: Fix fall-through warnings for Clang
phy: qcom-usb-hs: Fix fall-through warnings for Clang
rds: Fix fall-through warnings for Clang
rt2x00: Fix fall-through warnings for Clang
rtl8xxxu: Fix fall-through warnings for Clang
rtw88: Fix fall-through warnings for Clang
rxrpc: Fix fall-through warnings for Clang
scsi: aacraid: Fix fall-through warnings for Clang
scsi: aha1740: Fix fall-through warnings for Clang
scsi: csiostor: Fix fall-through warnings for Clang
scsi: lpfc: Fix fall-through warnings for Clang
scsi: stex: Fix fall-through warnings for Clang
sctp: Fix fall-through warnings for Clang
slimbus: messaging: Fix fall-through warnings for Clang
staging: qlge: Fix fall-through warnings for Clang
staging: vt6656: Fix fall-through warnings for Clang
SUNRPC: Fix fall-through warnings for Clang
tipc: Fix fall-through warnings for Clang
tpm: Fix fall-through warnings for Clang
ubi: Fix fall-through warnings for Clang
usb: Fix fall-through warnings for Clang
video: fbdev: lxfb_ops: Fix fall-through warnings for Clang
video: fbdev: pm2fb: Fix fall-through warnings for Clang
virtio_net: Fix fall-through warnings for Clang
wcn36xx: Fix fall-through warnings for Clang xen/manage: Fix fall-through warnings for Clang
xfrm: Fix fall-through warnings for Clang
zd1201: Fix fall-through warnings for Clang
Input: libps2 - Fix fall-through warnings for Clang

 arch/x86/events/core.c                                    | 2 +-
 arch/x86/kernel/kprobes/core.c                            | 1 +
 arch/x86/kernel/uprobes.c                                 | 2 ++
 drivers/accessibility/braille/braille_console.c           | 1 +
 drivers/acpi/sbshc.c                                      | 1 +
 drivers/ata/libata-eh.c                                   | 1 +
 drivers/atm/fore200e.c                                    | 1 +
 drivers/block/drbd/drbd_receiver.c                        | 1 +
 drivers/block/drbd/drbd_req.c                             | 1 +
 drivers/block/floppy.c                                    | 1 +
 drivers/block/xen-blkfront.c                              | 1 +
 drivers/char/tpm/eventlog/tpm1.c                          | 1 +
 drivers/crypto/ccree/cc_cipher.c                          | 3 +++
 drivers/firewire/core-topology.c                          | 1 +
 drivers/gpio/gpio-ath79.c                                 | 1 +
 drivers/gpio/gpiolib-acpi.c                               | 1 +
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c                    | 1 +
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c                     | 1 +
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c                     | 1 +
 drivers/gpu/drm/amd/amdgpu/vi.c                           | 1 +
 drivers/gpu/drm/amd/display/dc/bios/bios_parser.c         | 1 +
 drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c        | 2 ++
 drivers/gpu/drm/amd/display/dc/core/dc_link.c             | 1 +
 drivers/gpu/drm/amd/pm/powerplay/si_dpm.c                 | 2 +-
 .../gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c    | 1 +
 drivers/gpu/drm/drm_bufs.c                                | 1 +
 drivers/gpu/drm/i915/gem/i915_gem_shrinker.c              | 1 +
 drivers/gpu/drm/nouveau/nouveau_bo.c                      | 1 +
 drivers/gpu/drm/nouveau/nouveau_connector.c               | 1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.c            | 1 +
 drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf119.c         | 1 +
 drivers/gpu/drm/radeon/ci_dpm.c                           | 2 +-
 drivers/gpu/drm/radeon/r300.c                             | 1 +
 drivers/gpu/drm/radeon/si_dpm.c                           | 2 +-
 drivers/gpu/drm/via/via_irq.c                             | 1 +
 drivers/hid/hid-input.c                                   | 1 +
 drivers/hid/usbhid/hid-core.c                             | 2 ++
 drivers/hwmon/corsair-cpro.c                              | 1 +
 drivers/hwmon/max6621.c                                   | 2 +-
 drivers/i3c/master/i3c-master-cdns.c                      | 2 ++
 drivers/ide/siimage.c                                     | 1 +
 drivers/iio/adc/cpcap-adc.c                               | 1 +
 drivers/infiniband/hw/hfi1/qp.c                           | 1 +
 drivers/infiniband/hw/hfi1/tid_rdma.c                     | 5 +++++
 drivers/infiniband/hw/mlx4/mad.c                          | 1 +
 drivers/infiniband/hw/mlx5/qp.c                           | 1 +
 drivers/infiniband/hw/qedr/main.c                         | 1 +
 drivers/input/misc/pcspkr.c                               | 1 +
 drivers/input/serio/libps2.c                              | 2 +-
 drivers/md/dm-raid.c                                      | 1 +
 drivers/media/dvb-core/dvb_frontend.c                     | 1 +
 drivers/media/dvb-frontends/cx24120.c                     | 1 +
 drivers/media/dvb-frontends/dib0090.c                     | 2 ++
 drivers/media/dvb-frontends/drxk_hard.c                   | 1 +
 drivers/media/dvb-frontends/m88rs2000.c                   | 1 +
 drivers/media/pci/saa7134/saa7134-tvaudio.c               | 1 +
 drivers/media/platform/rcar_jpu.c                         | 1 +
 drivers/media/usb/dvb-usb-v2/af9015.c                     | 1 +
 drivers/media/usb/dvb-usb-v2/lmedm04.c                    | 1 +
 drivers/misc/habanalabs/gaudi/gaudi.c                     | 1 +
 drivers/mmc/host/sdhci-of-arasan.c                        | 4 ++++
 drivers/mtd/chips/cfi_cmdset_0001.c                       | 1 +
 drivers/mtd/chips/cfi_cmdset_0002.c                       | 2 ++
 drivers/mtd/chips/cfi_cmdset_0020.c                       | 2 ++
 drivers/mtd/mtdchar.c                                     | 1 +
 drivers/mtd/nand/onenand/onenand_samsung.c                | 1 +
 drivers/mtd/nand/raw/fsmc_nand.c                          | 1 +
 drivers/mtd/nand/raw/stm32_fmc2_nand.c                    | 2 ++
 drivers/mtd/ubi/build.c                                   | 1 +
 drivers/net/can/usb/peak_usb/pcan_usb_core.c              | 2 ++
 drivers/net/ethernet/3com/3c509.c                         | 1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt.c                 | 1 +
 drivers/net/ethernet/intel/e1000/e1000_hw.c               | 1 +
 drivers/net/ethernet/intel/fm10k/fm10k_mbx.c              | 2 ++
 drivers/net/ethernet/intel/ice/ice_txrx_lib.c             | 1 +
 drivers/net/ethernet/intel/igb/e1000_phy.c                | 1 +
 drivers/net/ethernet/intel/igb/igb_ethtool.c              | 1 +
 drivers/net/ethernet/intel/igb/igb_ptp.c                  | 1 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c            | 2 ++
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.c           | 1 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c              | 1 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c              | 1 +
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c         | 1 +
 drivers/net/ethernet/mellanox/mlx4/resource_tracker.c     | 1 +
 drivers/net/ethernet/mscc/ocelot_vcap.c                   | 1 +
 drivers/net/ethernet/neterion/vxge/vxge-config.c          | 1 +
 drivers/net/ethernet/netronome/nfp/nfp_net_repr.c         | 1 +
 drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c      | 1 +
 drivers/net/ethernet/qlogic/qed/qed_l2.c                  | 1 +
 drivers/net/ethernet/qlogic/qed/qed_sriov.c               | 1 +
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c            | 1 +
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c          | 1 +
 drivers/net/ethernet/sun/cassini.c                        | 1 +
 drivers/net/plip/plip.c                                   | 2 ++
 drivers/net/virtio_net.c                                  | 1 +
 drivers/net/wireless/ath/ath5k/mac80211-ops.c             | 1 +
 drivers/net/wireless/ath/carl9170/tx.c                    | 1 +
 drivers/net/wireless/ath/wcn36xx/smd.c                    | 2 +-
 drivers/net/wireless/cisco/airo.c                         | 1 +
 drivers/net/wireless/intel/iwlwifi/iwl-drv.c              | 2 +-
 drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c        | 2 +-
 drivers/net/wireless/ralink/rt2x00/rt2x00queue.c          | 1 +
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c     | 8 ++++----
 drivers/net/wireless/realtek/rtw88/fw.c                   | 2 +-
 drivers/net/wireless/zydas/zd1201.c                       | 2 +-
 drivers/phy/qualcomm/phy-qcom-usb-hs.c                    | 1 +
 drivers/pinctrl/renesas/pinctrl-rza1.c                    | 1 +
 drivers/regulator/as3722-regulator.c                      | 3 ++-
 drivers/scsi/aacraid/commsup.c                            | 1 +
 drivers/scsi/aha1740.c                                    | 1 +
 drivers/scsi/aic7xxx/aic79xx_core.c                       | 4 +++-
 drivers/scsi/aic7xxx/aic7xxx_core.c                       | 4 ++--
 drivers/scsi/aic94xx/aic94xx_scb.c                        | 2 ++
 drivers/scsi/aic94xx/aic94xx_task.c                       | 2 ++
 drivers/scsi/bfa/bfa_fcs_lport.c                          | 2 +-
 drivers/scsi/bfa/bfa_ioc.c                                | 6 ++++--
 drivers/scsi/csiostor/csio_wr.c                           | 1 +
 drivers/scsi/lpfc/lpfc_bsg.c                              | 1 +
 drivers/scsi/stex.c                                       | 1 +
 drivers/slimbus/messaging.c                               | 1 +
 drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c   | 1 +
 drivers/staging/qlge/qlge_main.c                          | 1 +
 drivers/staging/rtl8723bs/core/rtw_cmd.c                  | 1 +
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c             | 1 +
 drivers/staging/rtl8723bs/core/rtw_wlan_util.c            | 1 +
 drivers/staging/vt6655/device_main.c                      | 1 +
 drivers/staging/vt6655/rxtx.c                             | 2 ++
 drivers/staging/vt6656/main_usb.c                         | 1 +
 drivers/target/target_core_iblock.c                       | 1 +
 drivers/target/target_core_pr.c                           | 1 +
 drivers/tee/tee_core.c                                    | 1 +
 drivers/usb/gadget/function/f_fs.c                        | 2 ++
 drivers/usb/gadget/function/f_loopback.c                  | 2 +-
 drivers/usb/gadget/function/f_sourcesink.c                | 1 +
 drivers/usb/gadget/udc/dummy_hcd.c                        | 2 ++
 drivers/usb/host/fotg210-hcd.c                            | 2 +-
 drivers/usb/host/isp116x-hcd.c                            | 1 +
 drivers/usb/host/max3421-hcd.c                            | 1 +
 drivers/usb/host/oxu210hp-hcd.c                           | 1 +
 drivers/usb/misc/yurex.c                                  | 1 +
 drivers/usb/musb/tusb6010.c                               | 1 +
 drivers/usb/storage/ene_ub6250.c                          | 1 +
 drivers/usb/storage/uas.c                                 | 1 +
 drivers/video/fbdev/geode/lxfb_ops.c                      | 1 +
 drivers/video/fbdev/pm2fb.c                               | 1 +
 drivers/watchdog/machzwd.c                                | 1 +
 drivers/xen/manage.c                                      | 1 +
 fs/afs/cmservice.c                                        | 5 +++++
 fs/afs/fsclient.c                                         | 4 ++++
 fs/afs/vlclient.c                                         | 1 +
 fs/ceph/dir.c                                             | 2 ++
 fs/cifs/inode.c                                           | 1 +
 fs/cifs/sess.c                                            | 1 +
 fs/cifs/smbdirect.c                                       | 1 +
 fs/ext2/inode.c                                           | 1 +
 fs/ext4/super.c                                           | 1 +
 fs/gfs2/inode.c                                           | 2 ++
 fs/gfs2/recovery.c                                        | 1 +
 fs/isofs/rock.c                                           | 1 +
 fs/nfs/nfs3acl.c                                          | 1 +
 fs/nfs/nfs4client.c                                       | 1 +
 fs/nfs/nfs4proc.c                                         | 2 ++
 fs/nfs/nfs4state.c                                        | 1 +
 fs/nfs/pnfs.c                                             | 2 ++
 fs/nfsd/nfs4state.c                                       | 1 +
 fs/nfsd/nfsctl.c                                          | 1 +
 fs/reiserfs/namei.c                                       | 1 +
 mm/mm_init.c                                              | 1 +
 mm/vmscan.c                                               | 1 +
 net/ax25/af_ax25.c                                        | 1 +
 net/bridge/br_input.c                                     | 1 +
 net/core/dev.c                                            | 1 +
 net/decnet/dn_route.c                                     | 2 +-
 net/ipv4/ah4.c                                            | 1 +
 net/ipv4/esp4.c                                           | 1 +
 net/ipv4/fib_semantics.c                                  | 1 +
 net/ipv4/ip_vti.c                                         | 1 +
 net/ipv4/ipcomp.c                                         | 1 +
 net/ipv4/netfilter/ipt_REJECT.c                           | 1 +
 net/mac80211/cfg.c                                        | 2 ++
 net/netfilter/nf_conntrack_proto_dccp.c                   | 1 +
 net/netfilter/nf_tables_api.c                             | 1 +
 net/netfilter/nft_ct.c                                    | 1 +
 net/netrom/nr_route.c                                     | 4 ++++
 net/packet/af_packet.c                                    | 1 +
 net/rds/tcp_connect.c                                     | 1 +
 net/rds/threads.c                                         | 2 ++
 net/rose/rose_route.c                                     | 2 ++
 net/rxrpc/af_rxrpc.c                                      | 1 +
 net/sctp/input.c                                          | 3 ++-
 net/sunrpc/rpc_pipe.c                                     | 1 +
 net/sunrpc/xprtsock.c                                     | 1 +
 net/tipc/link.c                                           | 1 +
 net/wireless/nl80211.c                                    | 1 +
 net/wireless/util.c                                       | 1 +
 net/xfrm/xfrm_interface.c                                 | 1 +
 security/integrity/ima/ima_main.c                         | 1 +
 security/integrity/ima/ima_policy.c                       | 2 ++
 security/keys/process_keys.c                              | 1 +
 security/selinux/hooks.c                                  | 1 +
 sound/drivers/pcsp/pcsp_input.c                           | 1 +
 sound/isa/sb/sb8_main.c                                   | 1 +
 sound/pci/rme9652/hdspm.c                                 | 1 +
 sound/soc/codecs/adav80x.c                                | 1 +
 sound/soc/codecs/arizona.c                                | 1 +
 sound/soc/codecs/cs42l52.c                                | 1 +
 sound/soc/codecs/cs42l56.c                                | 1 +
 sound/soc/codecs/cs47l92.c                                | 1 +
 sound/soc/codecs/wm8962.c                                 | 1 +
 209 files changed, 264 insertions(+), 26 deletions(-)
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/141 afs: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple fallthrough pseudo-keywords in places where the code is intended to fall through to the next case.

---
 fs/afs/cmservice.c | 5 +++++
 fs/afs/fsclient.c  | 4 ++++
 fs/afs/vlclient.c  | 1 +
 3 files changed, 10 insertions(+)
fs/afs/cmservice.c +5 -0
index a4e9e6e07e93..d17b31dfe63f 100644
@@ -322,6 +322,8 @@ static int afs_deliver_cb_callback(struct afs_call *call)
 			return ret;
 
 		call->unmarshall++;
+
+		fallthrough;
 	case 5:
 		break;
 	}
@@ -419,6 +421,7 @@ static int afs_deliver_cb_init_call_back_state3(struct afs_call *call)
 
 		call->unmarshall++;
 
+		fallthrough;
 	case 2:
 		break;
 	}
@@ -531,6 +534,7 @@ static int afs_deliver_cb_probe_uuid(struct afs_call *call)
 
 		call->unmarshall++;
 
+		fallthrough;
 	case 2:
 		break;
 	}
@@ -664,6 +668,7 @@ static int afs_deliver_yfs_cb_callback(struct afs_call *call)
 		afs_extract_to_tmp(call);
 		call->unmarshall++;
 
+		fallthrough;
 	case 3:
 		break;
 	}
fs/afs/fsclient.c +4 -0
index 1d95ed9dd86e..a00eaa155012 100644
@@ -405,6 +405,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call)
 		req->file_size = vp->scb.status.size;
 
 		call->unmarshall++;
+		fallthrough;
 
 	case 5:
 		break;
@@ -1444,6 +1445,7 @@ static int afs_deliver_fs_get_volume_status(struct afs_call *call)
 		_debug("motd '%s'", p);
 
 		call->unmarshall++;
+		fallthrough;
 
 	case 8:
 		break;
@@ -1881,6 +1883,7 @@ static int afs_deliver_fs_inline_bulk_status(struct afs_call *call)
 		xdr_decode_AFSVolSync(&bp, &op->volsync);
 
 		call->unmarshall++;
+		fallthrough;
 
 	case 6:
 		break;
@@ -2015,6 +2018,7 @@ static int afs_deliver_fs_fetch_acl(struct afs_call *call)
 		xdr_decode_AFSVolSync(&bp, &op->volsync);
 
 		call->unmarshall++;
+		fallthrough;
 
 	case 4:
 		break;
fs/afs/vlclient.c +1 -0
index dc9327332f06..29930ea16652 100644
@@ -594,6 +594,7 @@ static int afs_deliver_yfsvl_get_endpoints(struct afs_call *call)
 			return ret;
 		call->unmarshall = 6;
 
+		fallthrough;
 	case 6:
 		break;
 	}
Signature · 1 line
2.27.0
#2 lore raw

Re: [PATCH 001/141] afs: Fix fall-through warnings for Clang

Quoted 4 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple fallthrough pseudo-keywords in places where the code is intended to fall through to the next case.

This is the first of the actual patches I've seen.
I think adding fallthough for these patches isn't the best option.

fs/afs/cmservice.c

Quoted 1 line
fs/afs/cmservice.c +0 -0

[]

fs/afs/cmservice.c static int afs_deliver_cb_callback(struct afs_call *call) · line 326

Quoted 7 lines
fs/afs/cmservice.c +0 -0
@@ -322,6 +322,8 @@ static int afs_deliver_cb_callback(struct afs_call *call)
  			return ret;

  call->unmarshall++;

fs/afs/cmservice.c +2 -0
+
+		fallthrough;

My preference would be to change these to break and not fallthrough;

Quoted 3 lines

  case 5:
  break;
  }

etc...

#3 lore raw

Re: [PATCH 001/141] afs: Fix fall-through warnings for Clang

Quoted 1 line · Joe Perches

My preference would be to change these to break and not fallthrough;

And my preference is fallthrough.

Joe, please, let the maintainer share their opinion on this first.

Thanks
--
Gustavo

#4 lore raw

Re: [PATCH 001/141] afs: Fix fall-through warnings for Clang

Quoted 5 lines · Gustavo A. R. Silva
Quoted 1 line · Joe Perches

My preference would be to change these to break and not fallthrough;

And my preference is fallthrough.

If so, that's an unusual choice here as it seems most or all of the other patches you submitted use break in the same situation where the next case is a single line break;

see: patches 2, 3, 4, 8, 9, etc...

Quoted 1 line

Joe, please, let the maintainer share their opinion on this first.

Why?
My preferences are my preferences and I don't mind announcing them.

maintainer
#5 lore raw

Re: [PATCH 001/141] afs: Fix fall-through warnings for Clang

In reply to Joe Perches
Quoted 9 lines · Joe Perches

fs/afs/cmservice.c static int afs_deliver_cb_callback(struct afs_call *call) · line 326

Quoted 3 lines

  call->unmarshall++;

fs/afs/cmservice.c +2 -0
+
+		fallthrough;

My preference would be to change these to break and not fallthrough;

Quoted 3 lines

  case 5:
  break;
  }

My preference would be to fall through. The case number is the state machine state, as indexed by call->unmarshall. All the other cases in the switch fall through.

I would also generally prefer that the fallthrough statement occur before the blank line, not after it, since it belongs with the previous clause, and not between a comment about a case statement and its associated case statement, i.e.:

		afs_extract_to_tmp(call);
		call->unmarshall++;

		/* extract the callback array and its count in two steps */
		fallthrough;
	case 3:

would be better written as:

		afs_extract_to_tmp(call);
		call->unmarshall++;
		fallthrough;

		/* extract the callback array and its count in two steps */
	case 3:

David

#6 lore raw

Re: [PATCH 001/141] afs: Fix fall-through warnings for Clang

Quoted 8 lines · David Howells
Quoted 6 lines · Joe Perches

fs/afs/cmservice.c static int afs_deliver_cb_callback(struct afs_call *call) · line 326

Quoted 3 lines

  call->unmarshall++;

fs/afs/cmservice.c +2 -0
+
+		fallthrough;

My preference would be to change these to break and not fallthrough;

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

  case 5:
  break;
  }

My preference would be to fall through. The case number is the state machine state, as indexed by call->unmarshall.

Then ideally the state machine states should be enums and not numbers and the compiler should use a default block for unhandled states right?

Is code like call->marshall++ a common style for kernel state machines? Perhaps not.

Does it work?
Sure.

Is it obvious what the transitions are?
No.

Quoted 14 lines

All the other cases in the switch fall through.

I would also generally prefer that the fallthrough statement occur before the blank line, not after it, since it belongs with the previous clause, and not between a comment about a case statement and its associated case statement, i.e.:

		afs_extract_to_tmp(call);
		call->unmarshall++;

		/* extract the callback array and its count in two steps */
		fallthrough;
	case 3:
Quoted 8 lines

would be better written as:

		afs_extract_to_tmp(call);
		call->unmarshall++;
		fallthrough;

		/* extract the callback array and its count in two steps */
	case 3:

I agree completely.

maintainer
#7 lore raw

Re: [PATCH 001/141] afs: Fix fall-through warnings for Clang

Quoted 8 lines · Joe Perches
Quoted 2 lines

My preference would be to fall through. The case number is the state machine state, as indexed by call->unmarshall.

Then ideally the state machine states should be enums and not numbers and the compiler should use a default block for unhandled states right?

Is code like call->marshall++ a common style for kernel state machines? Perhaps not.

How the value is interpreted is unique to each delivery function, of which there are a number, since it counts out the separate parts of the xdr encoding for that particular RPC request or reply block.

Maybe "state machine" isn't the right term.

David

#8 lore raw

PATCH 2/141 ASoC: codecs: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through, and also add fallthrough pseudo-keywords in places where the code is intended to fall through to the next case.

---
 sound/soc/codecs/adav80x.c | 1 +
 sound/soc/codecs/arizona.c | 1 +
 sound/soc/codecs/cs42l52.c | 1 +
 sound/soc/codecs/cs42l56.c | 1 +
 sound/soc/codecs/cs47l92.c | 1 +
 sound/soc/codecs/wm8962.c  | 1 +
 6 files changed, 6 insertions(+)
sound/soc/codecs/adav80x.c +1 -0
index 4fd99280d7db..75a649108106 100644
@@ -373,6 +373,7 @@ static int adav80x_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	case SND_SOC_DAIFMT_CBM_CFM:
 		capture |= ADAV80X_CAPTURE_MODE_MASTER;
 		playback |= ADAV80X_PLAYBACK_MODE_MASTER;
+		break;
 	case SND_SOC_DAIFMT_CBS_CFS:
 		break;
 	default:
sound/soc/codecs/arizona.c +1 -0
index 1228f2de0297..e32871b3f68a 100644
@@ -1034,6 +1034,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,
 				priv->out_down_delay++;
 				break;
 			}
+			break;
 		default:
 			break;
 		}
sound/soc/codecs/cs42l52.c +1 -0
index f772628f233e..796b894c390f 100644
@@ -944,6 +944,7 @@ static int cs42l52_beep_event(struct input_dev *dev, unsigned int type,
 	case SND_BELL:
 		if (hz)
 			hz = 261;
+		break;
 	case SND_TONE:
 		break;
 	default:
sound/soc/codecs/cs42l56.c +1 -0
index 97024a6ac96d..bb9599cc832b 100644
@@ -1008,6 +1008,7 @@ static int cs42l56_beep_event(struct input_dev *dev, unsigned int type,
 	case SND_BELL:
 		if (hz)
 			hz = 261;
+		break;
 	case SND_TONE:
 		break;
 	default:
sound/soc/codecs/cs47l92.c +1 -0
index 6e34106c268f..52dc29942ec2 100644
@@ -201,6 +201,7 @@ static int cs47l92_outclk_ev(struct snd_soc_dapm_widget *w,
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
sound/soc/codecs/wm8962.c +1 -0
index 0bd3bbc2aacf..3af456010b9c 100644
@@ -3203,6 +3203,7 @@ static int wm8962_beep_event(struct input_dev *dev, unsigned int type,
 	case SND_BELL:
 		if (hz)
 			hz = 1000;
+		fallthrough;
 	case SND_TONE:
 		break;
 	default:
Signature · 1 line
2.27.0
#9 lore raw

PATCH 3/141 cifs: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break/goto statements instead of just letting the code fall through to the next case.

---
 fs/cifs/inode.c     | 1 +
 fs/cifs/sess.c      | 1 +
 fs/cifs/smbdirect.c | 1 +
 3 files changed, 3 insertions(+)
fs/cifs/inode.c +1 -0
index 9ee5f304592f..ac01f9684b39 100644
@@ -771,6 +771,7 @@ cifs_get_file_info(struct file *filp)
 		 */
 		rc = 0;
 		CIFS_I(inode)->time = 0;
+		goto cgfi_exit;
 	default:
 		goto cgfi_exit;
 	}
fs/cifs/sess.c +1 -0
index de564368a887..6c2c42f8d893 100644
@@ -812,6 +812,7 @@ cifs_select_sectype(struct TCP_Server_Info *server, enum securityEnum requested)
 				return NTLMv2;
 			if (global_secflags & CIFSSEC_MAY_NTLM)
 				return NTLM;
+			break;
 		default:
 			break;
 		}
fs/cifs/smbdirect.c +1 -0
index b029ed31ef91..10dfe5006792 100644
@@ -246,6 +246,7 @@ smbd_qp_async_error_upcall(struct ib_event *event, void *context)
 	case IB_EVENT_CQ_ERR:
 	case IB_EVENT_QP_FATAL:
 		smbd_disconnect_rdma_connection(info);
+		break;
 
 	default:
 		break;
Signature · 1 line
2.27.0
Applied
#10 lore raw

Re: [PATCH 003/141] cifs: Fix fall-through warnings for Clang

Merged into cifs-2.6.git for-next

Let me know if you see any other cleanup/misc cifs.ko patches that may have gotten missed ...

Quoted 52 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break/goto statements instead of just letting the code fall through to the next case.

---
 fs/cifs/inode.c     | 1 +
 fs/cifs/sess.c      | 1 +
 fs/cifs/smbdirect.c | 1 +
 3 files changed, 3 insertions(+)
fs/cifs/inode.c +1 -0
index 9ee5f304592f..ac01f9684b39 100644
@@ -771,6 +771,7 @@ cifs_get_file_info(struct file *filp)
                 */
                rc = 0;
                CIFS_I(inode)->time = 0;
+               goto cgfi_exit;
        default:
                goto cgfi_exit;
        }
fs/cifs/sess.c +1 -0
index de564368a887..6c2c42f8d893 100644
@@ -812,6 +812,7 @@ cifs_select_sectype(struct TCP_Server_Info *server, enum securityEnum requested)
                                return NTLMv2;
                        if (global_secflags & CIFSSEC_MAY_NTLM)
                                return NTLM;
+                       break;
                default:
                        break;
                }
fs/cifs/smbdirect.c +1 -1
index b029ed31ef91..10dfe5006792 100644
@@ -246,6 +246,7 @@ smbd_qp_async_error_upcall(struct ib_event *event, void *context)
        case IB_EVENT_CQ_ERR:
        case IB_EVENT_QP_FATAL:
                smbd_disconnect_rdma_connection(info);
+               break;
 
        default:
                break;
--

2.27.0

Signature · 3 lines
Thanks,

Steve
#11 lore raw

PATCH 4/141 drm/amdgpu: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 +
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c  | 1 +
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c  | 1 +
 drivers/gpu/drm/amd/amdgpu/vi.c        | 1 +
 4 files changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -0
index 3579565e0eab..98ca6b976b6e 100644
@@ -8398,6 +8398,7 @@ static int gfx_v10_0_set_priv_inst_fault_state(struct amdgpu_device *adev,
 		WREG32_FIELD15(GC, 0, CP_INT_CNTL_RING0,
 			       PRIV_INSTR_INT_ENABLE,
 			       state == AMDGPU_IRQ_STATE_ENABLE ? 1 : 0);
+		break;
 	default:
 		break;
 	}
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -0
index 0d8e203b10ef..e61121629b93 100644
@@ -5683,6 +5683,7 @@ static int gfx_v9_0_set_priv_inst_fault_state(struct amdgpu_device *adev,
 		WREG32_FIELD15(GC, 0, CP_INT_CNTL_RING0,
 			       PRIV_INSTR_INT_ENABLE,
 			       state == AMDGPU_IRQ_STATE_ENABLE ? 1 : 0);
+		break;
 	default:
 		break;
 	}
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +1 -0
index 3ebbddb63705..584b99b80c29 100644
@@ -502,6 +502,7 @@ static int gmc_v9_0_vm_fault_interrupt_state(struct amdgpu_device *adev,
 				WREG32(reg, tmp);
 			}
 		}
+		break;
 	default:
 		break;
 	}
drivers/gpu/drm/amd/amdgpu/vi.c +1 -0
index 9bcd0eebc6d7..d56b474b3a21 100644
@@ -1645,6 +1645,7 @@ static int vi_common_set_clockgating_state(void *handle,
 	case CHIP_POLARIS12:
 	case CHIP_VEGAM:
 		vi_common_set_clockgating_state_by_smu(adev, state);
+		break;
 	default:
 		break;
 	}
Signature · 6 lines
2.27.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Applied
#12 lore raw

Re: [PATCH 004/141] drm/amdgpu: Fix fall-through warnings for Clang

Quoted 7 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

Applied. Thanks!

Alex

Quoted 62 lines
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 +
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c  | 1 +
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c  | 1 +
 drivers/gpu/drm/amd/amdgpu/vi.c        | 1 +
 4 files changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -0
index 3579565e0eab..98ca6b976b6e 100644
@@ -8398,6 +8398,7 @@ static int gfx_v10_0_set_priv_inst_fault_state(struct amdgpu_device *adev,
                WREG32_FIELD15(GC, 0, CP_INT_CNTL_RING0,
                               PRIV_INSTR_INT_ENABLE,
                               state == AMDGPU_IRQ_STATE_ENABLE ? 1 : 0);
+               break;
        default:
                break;
        }
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -0
index 0d8e203b10ef..e61121629b93 100644
@@ -5683,6 +5683,7 @@ static int gfx_v9_0_set_priv_inst_fault_state(struct amdgpu_device *adev,
                WREG32_FIELD15(GC, 0, CP_INT_CNTL_RING0,
                               PRIV_INSTR_INT_ENABLE,
                               state == AMDGPU_IRQ_STATE_ENABLE ? 1 : 0);
+               break;
        default:
                break;
        }
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +1 -0
index 3ebbddb63705..584b99b80c29 100644
@@ -502,6 +502,7 @@ static int gmc_v9_0_vm_fault_interrupt_state(struct amdgpu_device *adev,
                                WREG32(reg, tmp);
                        }
                }
+               break;
        default:
                break;
        }
drivers/gpu/drm/amd/amdgpu/vi.c +1 -1
index 9bcd0eebc6d7..d56b474b3a21 100644
@@ -1645,6 +1645,7 @@ static int vi_common_set_clockgating_state(void *handle,
        case CHIP_POLARIS12:
        case CHIP_VEGAM:
                vi_common_set_clockgating_state_by_smu(adev, state);
+               break;
        default:
                break;
        }
--

2.27.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#13 lore raw

Re: [PATCH 004/141] drm/amdgpu: Fix fall-through warnings for Clang

Quoted 11 lines · Alex Deucher
Quoted 7 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

Applied. Thanks!

Thanks, Alex.
--
Gustavo
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#14 lore raw

PATCH 5/141 drm/radeon: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple fallthrough pseudo-keyword macros, as replacement for /* fall through */ comments.

Notice that Clang doesn't recognize /* fall through */ comments as implicit fall-through markings.

---
 drivers/gpu/drm/radeon/ci_dpm.c | 2 +-
 drivers/gpu/drm/radeon/r300.c   | 1 +
 drivers/gpu/drm/radeon/si_dpm.c | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/ci_dpm.c +1 -1
index 886e9959496f..3d0a2e81b2de 100644
@@ -4860,8 +4860,8 @@ static void ci_request_link_speed_change_before_state_change(struct radeon_devic
 		case RADEON_PCIE_GEN2:
 			if (radeon_acpi_pcie_performance_request(rdev, PCIE_PERF_REQ_PECI_GEN2, false) == 0)
 				break;
+			fallthrough;
 #endif
-			/* fall through */
 		default:
 			pi->force_pcie_gen = ci_get_current_pcie_speed(rdev);
 			break;
drivers/gpu/drm/radeon/r300.c +1 -0
index 73f67bf222e1..213dc49b6322 100644
@@ -1162,6 +1162,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
 		/* valid register only on RV530 */
 		if (p->rdev->family == CHIP_RV530)
 			break;
+		fallthrough;
 		/* fallthrough do not move */
 	default:
 		goto fail;
drivers/gpu/drm/radeon/si_dpm.c +1 -1
index d1c73e9db889..d19c08e0ad5a 100644
@@ -5748,8 +5748,8 @@ static void si_request_link_speed_change_before_state_change(struct radeon_devic
 		case RADEON_PCIE_GEN2:
 			if (radeon_acpi_pcie_performance_request(rdev, PCIE_PERF_REQ_PECI_GEN2, false) == 0)
 				break;
+			fallthrough;
 #endif
-			/* fall through */
 		default:
 			si_pi->force_pcie_gen = si_get_current_pcie_speed(rdev);
 			break;
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#15 lore raw

Re: [PATCH 005/141] drm/radeon: Fix fall-through warnings for Clang

Quoted 10 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple fallthrough pseudo-keyword macros, as replacement for /* fall through */ comments.

Notice that Clang doesn't recognize /* fall through */ comments as implicit fall-through markings.

Applied. Thanks!

Alex

Quoted 53 lines
---
 drivers/gpu/drm/radeon/ci_dpm.c | 2 +-
 drivers/gpu/drm/radeon/r300.c   | 1 +
 drivers/gpu/drm/radeon/si_dpm.c | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/ci_dpm.c +1 -1
index 886e9959496f..3d0a2e81b2de 100644
@@ -4860,8 +4860,8 @@ static void ci_request_link_speed_change_before_state_change(struct radeon_devic
                case RADEON_PCIE_GEN2:
                        if (radeon_acpi_pcie_performance_request(rdev, PCIE_PERF_REQ_PECI_GEN2, false) == 0)
                                break;
+                       fallthrough;
 #endif
-                       /* fall through */
                default:
                        pi->force_pcie_gen = ci_get_current_pcie_speed(rdev);
                        break;
drivers/gpu/drm/radeon/r300.c +1 -0
index 73f67bf222e1..213dc49b6322 100644
@@ -1162,6 +1162,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
                /* valid register only on RV530 */
                if (p->rdev->family == CHIP_RV530)
                        break;
+               fallthrough;
                /* fallthrough do not move */
        default:
                goto fail;
drivers/gpu/drm/radeon/si_dpm.c +1 -2
index d1c73e9db889..d19c08e0ad5a 100644
@@ -5748,8 +5748,8 @@ static void si_request_link_speed_change_before_state_change(struct radeon_devic
                case RADEON_PCIE_GEN2:
                        if (radeon_acpi_pcie_performance_request(rdev, PCIE_PERF_REQ_PECI_GEN2, false) == 0)
                                break;
+                       fallthrough;
 #endif
-                       /* fall through */
                default:
                        si_pi->force_pcie_gen = si_get_current_pcie_speed(rdev);
                        break;
--

2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#16 lore raw

PATCH 6/141 gfs2: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple goto statements instead of just letting the code fall through to the next case.

---
 fs/gfs2/inode.c    | 2 ++
 fs/gfs2/recovery.c | 1 +
 2 files changed, 3 insertions(+)
fs/gfs2/inode.c +2 -0
index 077ccb1b3ccc..9a85214c2505 100644
@@ -960,6 +960,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
 		break;
 	case 0:
 		error = -EEXIST;
+		goto out_gunlock;
 	default:
 		goto out_gunlock;
 	}
@@ -1500,6 +1501,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
 			break;
 		case 0:
 			error = -EEXIST;
+			goto out_gunlock;
 		default:
 			goto out_gunlock;
 		}
fs/gfs2/recovery.c +1 -0
index c26c68ebd29d..5b2a01d9c463 100644
@@ -437,6 +437,7 @@ void gfs2_recover_func(struct work_struct *work)
 		case GLR_TRYFAILED:
 			fs_info(sdp, "jid=%u: Busy\n", jd->jd_jid);
 			error = 0;
+			goto fail;
 
 		default:
 			goto fail;
Signature · 1 line
2.27.0
#17 lore raw

Re: [PATCH 006/141] gfs2: Fix fall-through warnings for Clang

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 44 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple goto statements instead of just letting the code fall through to the next case.

---
 fs/gfs2/inode.c    | 2 ++
 fs/gfs2/recovery.c | 1 +
 2 files changed, 3 insertions(+)
fs/gfs2/inode.c +2 -0
index 077ccb1b3ccc..9a85214c2505 100644
@@ -960,6 +960,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
 		break;
 	case 0:
 		error = -EEXIST;
+		goto out_gunlock;
 	default:
 		goto out_gunlock;
 	}
@@ -1500,6 +1501,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
 			break;
 		case 0:
 			error = -EEXIST;
+			goto out_gunlock;
 		default:
 			goto out_gunlock;
 		}
fs/gfs2/recovery.c +1 -0
index c26c68ebd29d..5b2a01d9c463 100644
@@ -437,6 +437,7 @@ void gfs2_recover_func(struct work_struct *work)
 		case GLR_TRYFAILED:
 			fs_info(sdp, "jid=%u: Busy\n", jd->jd_jid);
 			error = 0;
+			goto fail;
 
 		default:
 			goto fail;
#18 lore raw

Re: [PATCH 006/141] gfs2: Fix fall-through warnings for Clang

Am Di., 20. Apr. 2021 um 22:29 Uhr schrieb Gustavo A. R. Silva <[email protected]>:

Quoted 1 line

Friendly ping: who can take this, please?

Oops, that got lost. I've added it to for-next now.

Thanks,
Andreas

#19 lore raw

PATCH 7/141 gpio: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a break and a fallthrough statements instead of just letting the code fall through to the next case.

---
 drivers/gpio/gpio-ath79.c   | 1 +
 drivers/gpio/gpiolib-acpi.c | 1 +
 2 files changed, 2 insertions(+)
drivers/gpio/gpio-ath79.c +1 -0
index d5359341cc6b..678ddd375891 100644
@@ -123,6 +123,7 @@ static int ath79_gpio_irq_set_type(struct irq_data *data,
 	switch (flow_type) {
 	case IRQ_TYPE_EDGE_RISING:
 		polarity |= mask;
+		fallthrough;
 	case IRQ_TYPE_EDGE_FALLING:
 	case IRQ_TYPE_EDGE_BOTH:
 		break;
drivers/gpio/gpiolib-acpi.c +1 -0
index 834a12f3219e..23fa9df8241d 100644
@@ -548,6 +548,7 @@ acpi_gpio_to_gpiod_flags(const struct acpi_resource_gpio *agpio)
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#20 lore raw

Re: [PATCH 007/141] gpio: Fix fall-through warnings for Clang

Quoted 3 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a break and a fallthrough statements instead of just letting the code fall through to the next case.

Shouldn't this go via GPIO tree?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#21 lore raw

Re: [PATCH 007/141] gpio: Fix fall-through warnings for Clang

Quoted 6 lines · Andy Shevchenko
Quoted 3 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a break and a fallthrough statements instead of just letting the code fall through to the next case.

Shouldn't this go via GPIO tree?

Yeah. Actually, you can ignore this patch, as I already sent two separate patches for this:

https://lore.kernel.org/lkml/20201119170901.GA22703@embeddedor/
https://lore.kernel.org/lkml/20201119170739.GA22665@embeddedor/

I noticed this immediately after sending this out.

Thanks
--
Gustavo

#22 lore raw

PATCH 8/141 IB/hfi1: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

---
 drivers/infiniband/hw/hfi1/qp.c       | 1 +
 drivers/infiniband/hw/hfi1/tid_rdma.c | 5 +++++
 2 files changed, 6 insertions(+)
drivers/infiniband/hw/hfi1/qp.c +1 -0
index 356518e17fa6..681bb4e918c9 100644
@@ -339,6 +339,7 @@ int hfi1_setup_wqe(struct rvt_qp *qp, struct rvt_swqe *wqe, bool *call_send)
 			return -EINVAL;
 		if (ibp->sl_to_sc[rdma_ah_get_sl(&ah->attr)] == 0xf)
 			return -EINVAL;
+		break;
 	default:
 		break;
 	}
drivers/infiniband/hw/hfi1/tid_rdma.c +5 -0
index 73d197e21730..92aa2a9b3b5a 100644
@@ -2826,6 +2826,7 @@ static bool handle_read_kdeth_eflags(struct hfi1_ctxtdata *rcd,
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
@@ -3005,6 +3006,7 @@ bool hfi1_handle_kdeth_eflags(struct hfi1_ctxtdata *rcd,
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
@@ -3221,6 +3223,7 @@ bool hfi1_tid_rdma_wqe_interlock(struct rvt_qp *qp, struct rvt_swqe *wqe)
 			req = wqe_to_tid_req(prev);
 			if (req->ack_seg != req->total_segs)
 				goto interlock;
+			break;
 		default:
 			break;
 		}
@@ -3239,9 +3242,11 @@ bool hfi1_tid_rdma_wqe_interlock(struct rvt_qp *qp, struct rvt_swqe *wqe)
 			req = wqe_to_tid_req(prev);
 			if (req->ack_seg != req->total_segs)
 				goto interlock;
+			break;
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
Tested-by on v1 8/141
#23 lore raw

Re: [PATCH 008/141] IB/hfi1: Fix fall-through warnings for Clang

Quoted 5 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

Looks good and tested with TID rdma to cover the interlock case.

Mike

#24 lore raw

Re: [PATCH 008/141] IB/hfi1: Fix fall-through warnings for Clang

Quoted 6 lines · Mike Marciniszyn
Quoted 4 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

Quoted 7 lines
Quoted 1 line

Looks good and tested with TID rdma to cover the interlock case.

Mike

Thanks, Mike.
--
Gustavo

#25 lore raw

PATCH 9/141 igb: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/intel/igb/e1000_phy.c   | 1 +
 drivers/net/ethernet/intel/igb/igb_ethtool.c | 1 +
 drivers/net/ethernet/intel/igb/igb_ptp.c     | 1 +
 3 files changed, 3 insertions(+)
drivers/net/ethernet/intel/igb/e1000_phy.c +1 -0
index 8c8eb82e6272..a018000f7db9 100644
@@ -836,6 +836,7 @@ s32 igb_copper_link_setup_igp(struct e1000_hw *hw)
 			break;
 		case e1000_ms_auto:
 			data &= ~CR_1000T_MS_ENABLE;
+			break;
 		default:
 			break;
 		}
drivers/net/ethernet/intel/igb/igb_ethtool.c +1 -0
index 28baf203459a..486d3e67d3a9 100644
@@ -3022,6 +3022,7 @@ static int igb_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
 		break;
 	case ETHTOOL_SRXCLSRLDEL:
 		ret = igb_del_ethtool_nfc_entry(adapter, cmd);
+		break;
 	default:
 		break;
 	}
drivers/net/ethernet/intel/igb/igb_ptp.c +1 -0
index 7cc5428c3b3d..f3ff565da0a1 100644
@@ -1008,6 +1008,7 @@ static int igb_ptp_set_timestamp_mode(struct igb_adapter *adapter,
 	switch (config->tx_type) {
 	case HWTSTAMP_TX_OFF:
 		tsync_tx_ctl = 0;
+		break;
 	case HWTSTAMP_TX_ON:
 		break;
 	default:
Signature · 1 line
2.27.0
#26 lore raw

PATCH 10/141 ima: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

---
 security/integrity/ima/ima_main.c   | 1 +
 security/integrity/ima/ima_policy.c | 2 ++
 2 files changed, 3 insertions(+)
security/integrity/ima/ima_main.c +1 -0
index 2d1af8899cab..600b97677085 100644
@@ -743,6 +743,7 @@ int ima_load_data(enum kernel_load_data_id id, bool contents)
 			pr_err("impossible to appraise a module without a file descriptor. sig_enforce kernel parameter might help\n");
 			return -EACCES;	/* INTEGRITY_UNKNOWN */
 		}
+		break;
 	default:
 		break;
 	}
security/integrity/ima/ima_policy.c +2 -0
index 9b5adeaa47fc..ea634fc3b82f 100644
@@ -566,6 +566,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode,
 			rc = ima_filter_rule_match(secid, rule->lsm[i].type,
 						   Audit_equal,
 						   rule->lsm[i].rule);
+			break;
 		default:
 			break;
 		}
@@ -802,6 +803,7 @@ void __init ima_init_policy(void)
 		add_rules(default_measurement_rules,
 			  ARRAY_SIZE(default_measurement_rules),
 			  IMA_DEFAULT_POLICY);
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#27 lore raw

Re: [PATCH 010/141] ima: Fix fall-through warnings for Clang

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 44 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

---
 security/integrity/ima/ima_main.c   | 1 +
 security/integrity/ima/ima_policy.c | 2 ++
 2 files changed, 3 insertions(+)
security/integrity/ima/ima_main.c +1 -0
index 2d1af8899cab..600b97677085 100644
@@ -743,6 +743,7 @@ int ima_load_data(enum kernel_load_data_id id, bool contents)
 			pr_err("impossible to appraise a module without a file descriptor. sig_enforce kernel parameter might help\n");
 			return -EACCES;	/* INTEGRITY_UNKNOWN */
 		}
+		break;
 	default:
 		break;
 	}
security/integrity/ima/ima_policy.c +2 -0
index 9b5adeaa47fc..ea634fc3b82f 100644
@@ -566,6 +566,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode,
 			rc = ima_filter_rule_match(secid, rule->lsm[i].type,
 						   Audit_equal,
 						   rule->lsm[i].rule);
+			break;
 		default:
 			break;
 		}
@@ -802,6 +803,7 @@ void __init ima_init_policy(void)
 		add_rules(default_measurement_rules,
 			  ARRAY_SIZE(default_measurement_rules),
 			  IMA_DEFAULT_POLICY);
+		break;
 	default:
 		break;
 	}
maintainer
#28 lore raw

Re: [PATCH 010/141] ima: Fix fall-through warnings for Clang

Hi Gustavo,

Quoted 3 lines · Gustavo A. R. Silva

Hi all,

Friendly ping: who can take this, please?

Thank you for the reminder.

Quoted 8 lines · Gustavo A. R. Silva
Quoted 6 lines

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git
next-integrity

thanks,

Mimi

#29 lore raw

Re: [PATCH 010/141] ima: Fix fall-through warnings for Clang

Quoted 3 lines · Mimi Zohar

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git
next-integrity

Thanks, Mimi.

--
Gustavo

#30 lore raw

PATCH 11/141 ipv4: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

---
 net/ipv4/ah4.c           | 1 +
 net/ipv4/esp4.c          | 1 +
 net/ipv4/fib_semantics.c | 1 +
 net/ipv4/ip_vti.c        | 1 +
 net/ipv4/ipcomp.c        | 1 +
 5 files changed, 5 insertions(+)
net/ipv4/ah4.c +1 -0
index d99e1be94019..18d451414601 100644
@@ -450,6 +450,7 @@ static int ah4_err(struct sk_buff *skb, u32 info)
 	case ICMP_DEST_UNREACH:
 		if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
 			return 0;
+		break;
 	case ICMP_REDIRECT:
 		break;
 	default:
net/ipv4/esp4.c +1 -0
index 8b07f3a4f2db..a12ef89e8520 100644
@@ -987,6 +987,7 @@ static int esp4_err(struct sk_buff *skb, u32 info)
 	case ICMP_DEST_UNREACH:
 		if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
 			return 0;
+		break;
 	case ICMP_REDIRECT:
 		break;
 	default:
net/ipv4/fib_semantics.c +1 -0
index 1f75dc686b6b..647a67516b80 100644
@@ -1872,6 +1872,7 @@ static int call_fib_nh_notifiers(struct fib_nh *nh,
 		    (nh->fib_nh_flags & RTNH_F_DEAD))
 			return call_fib4_notifiers(dev_net(nh->fib_nh_dev),
 						   event_type, &info.info);
+		break;
 	default:
 		break;
 	}
net/ipv4/ip_vti.c +1 -0
index b957cbee2cf7..60e0311ec51f 100644
@@ -349,6 +349,7 @@ static int vti4_err(struct sk_buff *skb, u32 info)
 	case ICMP_DEST_UNREACH:
 		if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
 			return 0;
+		break;
 	case ICMP_REDIRECT:
 		break;
 	default:
net/ipv4/ipcomp.c +1 -0
index b42683212c65..bbb56f5e06dd 100644
@@ -31,6 +31,7 @@ static int ipcomp4_err(struct sk_buff *skb, u32 info)
 	case ICMP_DEST_UNREACH:
 		if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
 			return 0;
+		break;
 	case ICMP_REDIRECT:
 		break;
 	default:
Signature · 1 line
2.27.0
#31 lore raw

PATCH 12/141 ixgbe: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c  | 2 ++
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 1 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c    | 1 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c    | 1 +
 4 files changed, 5 insertions(+)
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c +2 -0
index 8d3798a32f0e..cdfff510a27b 100644
@@ -1542,6 +1542,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
 	switch (input_mask->formatted.vm_pool & 0x7F) {
 	case 0x0:
 		fdirm |= IXGBE_FDIRM_POOL;
+		break;
 	case 0x7F:
 		break;
 	default:
@@ -1557,6 +1558,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
 			hw_dbg(hw, " Error on src/dst port mask\n");
 			return IXGBE_ERR_CONFIG;
 		}
+		break;
 	case IXGBE_ATR_L4TYPE_MASK:
 		break;
 	default:
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +1 -0
index 62ddb452f862..8d5a01be1d99 100644
@@ -93,6 +93,7 @@ bool ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw)
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c +1 -0
index df389a11d3af..0218f6c9b925 100644
@@ -132,6 +132,7 @@ static void ixgbe_get_first_reg_idx(struct ixgbe_adapter *adapter, u8 tc,
 			else
 				*tx = (tc + 4) << 4;	/* 96, 112 */
 		}
+		break;
 	default:
 		break;
 	}
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c +1 -0
index 22a874eee2e8..23ddfd79fc8b 100644
@@ -999,6 +999,7 @@ static int ixgbe_ptp_set_timestamp_mode(struct ixgbe_adapter *adapter,
 	switch (config->tx_type) {
 	case HWTSTAMP_TX_OFF:
 		tsync_tx_ctl = 0;
+		break;
 	case HWTSTAMP_TX_ON:
 		break;
 	default:
Signature · 1 line
2.27.0
#32 lore raw

PATCH 13/141 media: dvb-frontends: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break and a return statements instead of just letting the code fall through to the next case.

---
 drivers/media/dvb-frontends/cx24120.c   | 1 +
 drivers/media/dvb-frontends/dib0090.c   | 2 ++
 drivers/media/dvb-frontends/drxk_hard.c | 1 +
 drivers/media/dvb-frontends/m88rs2000.c | 1 +
 4 files changed, 5 insertions(+)
drivers/media/dvb-frontends/cx24120.c +1 -0
index 2464b63fe0cf..d8acd582c711 100644
@@ -363,6 +363,7 @@ static void cx24120_check_cmd(struct cx24120_state *state, u8 id)
 	case CMD_DISEQC_BURST:
 		cx24120_msg_mpeg_output_global_config(state, 0);
 		/* Old driver would do a msleep(100) here */
+		return;
 	default:
 		return;
 	}
drivers/media/dvb-frontends/dib0090.c +2 -0
index 08a85831e917..903da33642df 100644
@@ -1765,6 +1765,8 @@ static int dib0090_dc_offset_calibration(struct dib0090_state *state, enum front
 		dib0090_write_reg(state, 0x1f, 0x7);
 		*tune_state = CT_TUNER_START;	/* reset done -> real tuning can now begin */
 		state->calibrate &= ~DC_CAL;
+		break;
+
 	default:
 		break;
 	}
drivers/media/dvb-frontends/drxk_hard.c +1 -0
index a57470bf71bf..d7fc2595f15b 100644
@@ -3294,6 +3294,7 @@ static int dvbt_sc_command(struct drxk_state *state,
 	case OFDM_SC_RA_RAM_CMD_USER_IO:
 	case OFDM_SC_RA_RAM_CMD_GET_OP_PARAM:
 		status = read16(state, OFDM_SC_RA_RAM_PARAM0__A, &(param0));
+		break;
 		/* All commands yielding 0 results */
 	case OFDM_SC_RA_RAM_CMD_SET_ECHO_TIMING:
 	case OFDM_SC_RA_RAM_CMD_SET_TIMER:
drivers/media/dvb-frontends/m88rs2000.c +1 -0
index 39cbb3ea1c9d..b294ba87e934 100644
@@ -390,6 +390,7 @@ static int m88rs2000_tab_set(struct m88rs2000_state *state,
 		case 0xff:
 			if (tab[i].reg == 0xaa && tab[i].val == 0xff)
 				return 0;
+			break;
 		case 0x00:
 			break;
 		default:
Signature · 1 line
2.27.0
Reviewed-by on v1 13/141
#33 lore raw

Re: [PATCH 013/141] media: dvb-frontends: Fix fall-through warnings for Clang

Em Fri, 20 Nov 2020 12:26:09 -0600
"Gustavo A. R. Silva" <[email protected]> escreveu:

Quoted 3 lines

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break and a return statements instead of just letting the code fall through to the next case.

Quoted 52 lines
---
 drivers/media/dvb-frontends/cx24120.c   | 1 +
 drivers/media/dvb-frontends/dib0090.c   | 2 ++
 drivers/media/dvb-frontends/drxk_hard.c | 1 +
 drivers/media/dvb-frontends/m88rs2000.c | 1 +
 4 files changed, 5 insertions(+)
drivers/media/dvb-frontends/cx24120.c +1 -0
index 2464b63fe0cf..d8acd582c711 100644
@@ -363,6 +363,7 @@ static void cx24120_check_cmd(struct cx24120_state *state, u8 id)
 	case CMD_DISEQC_BURST:
 		cx24120_msg_mpeg_output_global_config(state, 0);
 		/* Old driver would do a msleep(100) here */
+		return;
 	default:
 		return;
 	}
drivers/media/dvb-frontends/dib0090.c +2 -0
index 08a85831e917..903da33642df 100644
@@ -1765,6 +1765,8 @@ static int dib0090_dc_offset_calibration(struct dib0090_state *state, enum front
 		dib0090_write_reg(state, 0x1f, 0x7);
 		*tune_state = CT_TUNER_START;	/* reset done -> real tuning can now begin */
 		state->calibrate &= ~DC_CAL;
+		break;
+
 	default:
 		break;
 	}
drivers/media/dvb-frontends/drxk_hard.c +1 -0
index a57470bf71bf..d7fc2595f15b 100644
@@ -3294,6 +3294,7 @@ static int dvbt_sc_command(struct drxk_state *state,
 	case OFDM_SC_RA_RAM_CMD_USER_IO:
 	case OFDM_SC_RA_RAM_CMD_GET_OP_PARAM:
 		status = read16(state, OFDM_SC_RA_RAM_PARAM0__A, &(param0));
+		break;
 		/* All commands yielding 0 results */
 	case OFDM_SC_RA_RAM_CMD_SET_ECHO_TIMING:
 	case OFDM_SC_RA_RAM_CMD_SET_TIMER:
drivers/media/dvb-frontends/m88rs2000.c +0 -0
index 39cbb3ea1c9d..b294ba87e934 100644

drivers/media/dvb-frontends/m88rs2000.c static int m88rs2000_tab_set(struct m88rs2000_state *state, · line 396

Quoted 7 lines
drivers/media/dvb-frontends/m88rs2000.c +1 -0
@@ -390,6 +390,7 @@ static int m88rs2000_tab_set(struct m88rs2000_state *state,
 		case 0xff:
 			if (tab[i].reg == 0xaa && tab[i].val == 0xff)
 				return 0;
+			break;
 		case 0x00:
 			break;
 		default:

Thanks,
Mauro

#34 lore raw

Re: [PATCH 013/141] media: dvb-frontends: Fix fall-through warnings for Clang

Quoted 8 lines · Mauro Carvalho Chehab

Em Fri, 20 Nov 2020 12:26:09 -0600
"Gustavo A. R. Silva" <[email protected]> escreveu:

Quoted 3 lines

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break and a return statements instead of just letting the code fall through to the next case.

Thanks, Mauro.
--
Gustavo

#35 lore raw

PATCH 14/141 media: usb: dvb-usb-v2: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a couple of break statements instead of just letting the code fall through to the next case.

---
 drivers/media/usb/dvb-usb-v2/af9015.c  | 1 +
 drivers/media/usb/dvb-usb-v2/lmedm04.c | 1 +
 2 files changed, 2 insertions(+)
drivers/media/usb/dvb-usb-v2/af9015.c +1 -0
index c70b3cef3176..d33514acc2b5 100644
@@ -51,6 +51,7 @@ static int af9015_ctrl_msg(struct dvb_usb_device *d, struct req_t *req)
 		if (((req->addr & 0xff00) == 0xff00) ||
 		    ((req->addr & 0xff00) == 0xae00))
 			state->buf[0] = WRITE_VIRTUAL_MEMORY;
+		break;
 	case WRITE_VIRTUAL_MEMORY:
 	case COPY_FIRMWARE:
 	case DOWNLOAD_FIRMWARE:
drivers/media/usb/dvb-usb-v2/lmedm04.c +1 -0
index 5a7a9522d46d..67c37fb267e3 100644
@@ -336,6 +336,7 @@ static void lme2510_int_response(struct urb *lme_urb)
 				st->signal_level = ibuf[5];
 				st->signal_sn = ibuf[4];
 				st->time_key = ibuf[7];
+				break;
 			default:
 				break;
 			}
Signature · 1 line
2.27.0
Reviewed-by on v1 14/141
#36 lore raw

Re: [PATCH 014/141] media: usb: dvb-usb-v2: Fix fall-through warnings for Clang

Em Fri, 20 Nov 2020 12:26:16 -0600
"Gustavo A. R. Silva" <[email protected]> escreveu:

Quoted 6 lines

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a couple of break statements instead of just letting the code fall through to the next case.

Quoted 22 lines
---
 drivers/media/usb/dvb-usb-v2/af9015.c  | 1 +
 drivers/media/usb/dvb-usb-v2/lmedm04.c | 1 +
 2 files changed, 2 insertions(+)
drivers/media/usb/dvb-usb-v2/af9015.c +1 -0
index c70b3cef3176..d33514acc2b5 100644
@@ -51,6 +51,7 @@ static int af9015_ctrl_msg(struct dvb_usb_device *d, struct req_t *req)
 		if (((req->addr & 0xff00) == 0xff00) ||
 		    ((req->addr & 0xff00) == 0xae00))
 			state->buf[0] = WRITE_VIRTUAL_MEMORY;
+		break;
 	case WRITE_VIRTUAL_MEMORY:
 	case COPY_FIRMWARE:
 	case DOWNLOAD_FIRMWARE:
drivers/media/usb/dvb-usb-v2/lmedm04.c +0 -0
index 5a7a9522d46d..67c37fb267e3 100644

drivers/media/usb/dvb-usb-v2/lmedm04.c static void lme2510_int_response(struct urb *lme_urb) · line 342

Quoted 7 lines
drivers/media/usb/dvb-usb-v2/lmedm04.c +1 -0
@@ -336,6 +336,7 @@ static void lme2510_int_response(struct urb *lme_urb)
 				st->signal_level = ibuf[5];
 				st->signal_sn = ibuf[4];
 				st->time_key = ibuf[7];
+				break;
 			default:
 				break;
 			}

Thanks,
Mauro

#37 lore raw

PATCH 15/141 netfilter: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

---
 net/netfilter/nf_conntrack_proto_dccp.c | 1 +
 net/netfilter/nf_tables_api.c           | 1 +
 net/netfilter/nft_ct.c                  | 1 +
 3 files changed, 3 insertions(+)
net/netfilter/nf_conntrack_proto_dccp.c +1 -0
index b3f4a334f9d7..94001eb51ffe 100644
@@ -397,6 +397,7 @@ dccp_new(struct nf_conn *ct, const struct sk_buff *skb,
 			msg = "not picking up existing connection ";
 			goto out_invalid;
 		}
+		break;
 	case CT_DCCP_REQUEST:
 		break;
 	case CT_DCCP_INVALID:
net/netfilter/nf_tables_api.c +1 -0
index 0f58e98542be..78d0bbc8868c 100644
@@ -8342,6 +8342,7 @@ static int nf_tables_check_loops(const struct nft_ctx *ctx,
 							data->verdict.chain);
 				if (err < 0)
 					return err;
+				break;
 			default:
 				break;
 			}
net/netfilter/nft_ct.c +1 -0
index 322bd674963e..fec68b75f39a 100644
@@ -530,6 +530,7 @@ static void __nft_ct_set_destroy(const struct nft_ctx *ctx, struct nft_ct *priv)
 	case NFT_CT_ZONE:
 		if (--nft_ct_pcpu_template_refcnt == 0)
 			nft_ct_tmpl_put_pcpu();
+		break;
 #endif
 	default:
 		break;
Signature · 1 line
2.27.0
maintainer Acked-by on v1 15/141
#38 lore raw

Re: [PATCH 015/141] netfilter: Fix fall-through warnings for Clang

Quoted 3 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

Feel free to carry this in next iteration of series, if any.

#39 lore raw

Re: [PATCH 015/141] netfilter: Fix fall-through warnings for Clang

Quoted 8 lines · Florian Westphal
Quoted 3 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

Feel free to carry this in next iteration of series, if any.

Thanks, Florian.
--
Gustavo

#40 lore raw

PATCH 16/141 nfsd: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a couple of break statements instead of just letting the code fall through to the next case.

---
 fs/nfsd/nfs4state.c | 1 +
 fs/nfsd/nfsctl.c    | 1 +
 2 files changed, 2 insertions(+)
fs/nfsd/nfs4state.c +1 -0
index d7f27ed6b794..cdab0d5be186 100644
@@ -3113,6 +3113,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 			goto out_nolock;
 		}
 		new->cl_mach_cred = true;
+		break;
 	case SP4_NONE:
 		break;
 	default:				/* checked by xdr code */
fs/nfsd/nfsctl.c +1 -0
index f6d5d783f4a4..9a3bb1e217f9 100644
@@ -1165,6 +1165,7 @@ static struct inode *nfsd_get_inode(struct super_block *sb, umode_t mode)
 		inode->i_fop = &simple_dir_operations;
 		inode->i_op = &simple_dir_inode_operations;
 		inc_nlink(inode);
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
Acked-by on v1 16/141
#41 lore raw

Re: [PATCH 016/141] nfsd: Fix fall-through warnings for Clang

Quoted 42 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a couple of break statements instead of just letting the code fall through to the next case.

---
fs/nfsd/nfs4state.c | 1 +
fs/nfsd/nfsctl.c | 1 +

2 files changed, 2 insertions(+)
fs/nfsd/nfs4state.c +1 -0
index d7f27ed6b794..cdab0d5be186 100644
@@ -3113,6 +3113,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 			goto out_nolock;
 		}
 		new->cl_mach_cred = true;
+		break;
 	case SP4_NONE:
 		break;
 	default:				/* checked by xdr code */
fs/nfsd/nfsctl.c +1 -0
index f6d5d783f4a4..9a3bb1e217f9 100644
@@ -1165,6 +1165,7 @@ static struct inode *nfsd_get_inode(struct super_block *sb, umode_t mode)
 		inode->i_fop = &simple_dir_operations;
 		inode->i_op = &simple_dir_inode_operations;
 		inc_nlink(inode);
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0

--
Chuck Lever

#42 lore raw

Re: [PATCH 016/141] nfsd: Fix fall-through warnings for Clang

Quoted 36 lines · Chuck Lever
Quoted 36 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a couple of break statements instead of just letting the code fall through to the next case.

---
fs/nfsd/nfs4state.c | 1 +
fs/nfsd/nfsctl.c | 1 +

2 files changed, 2 insertions(+)
fs/nfsd/nfs4state.c +1 -0
index d7f27ed6b794..cdab0d5be186 100644
@@ -3113,6 +3113,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 			goto out_nolock;
 		}
 		new->cl_mach_cred = true;
+		break;
 	case SP4_NONE:
 		break;
 	default:				/* checked by xdr code */
fs/nfsd/nfsctl.c +1 -0
index f6d5d783f4a4..9a3bb1e217f9 100644
@@ -1165,6 +1165,7 @@ static struct inode *nfsd_get_inode(struct super_block *sb, umode_t mode)
 		inode->i_fop = &simple_dir_operations;
 		inode->i_op = &simple_dir_inode_operations;
 		inc_nlink(inode);
+		break;
Quoted 8 lines
Quoted 6 lines
fs/nfsd/nfsctl.c +0 -0
 	default:
 		break;
 	}
Signature · 1 line
2.27.0

Thanks, Chuck.
--
Gustavo

#43 lore raw

Re: [PATCH 016/141] nfsd: Fix fall-through warnings for Clang

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 50 lines · Gustavo A. R. Silva
Quoted 36 lines · Chuck Lever
Quoted 36 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a couple of break statements instead of just letting the code fall through to the next case.

---
fs/nfsd/nfs4state.c | 1 +
fs/nfsd/nfsctl.c | 1 +

2 files changed, 2 insertions(+)
fs/nfsd/nfs4state.c +1 -0
index d7f27ed6b794..cdab0d5be186 100644
@@ -3113,6 +3113,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 			goto out_nolock;
 		}
 		new->cl_mach_cred = true;
+		break;
 	case SP4_NONE:
 		break;
 	default:				/* checked by xdr code */
fs/nfsd/nfsctl.c +1 -0
index f6d5d783f4a4..9a3bb1e217f9 100644
@@ -1165,6 +1165,7 @@ static struct inode *nfsd_get_inode(struct super_block *sb, umode_t mode)
 		inode->i_fop = &simple_dir_operations;
 		inode->i_op = &simple_dir_inode_operations;
 		inc_nlink(inode);
+		break;
Quoted 8 lines
Quoted 6 lines
fs/nfsd/nfsctl.c +0 -0
 	default:
 		break;
 	}
Signature · 1 line
2.27.0

Thanks, Chuck.
--
Gustavo

#44 lore raw

Re: [PATCH 016/141] nfsd: Fix fall-through warnings for Clang

Quoted 7 lines · Gustavo A. R. Silva

Hi all,

Friendly ping: who can take this, please?

Hum. I thought this was going through another tree. I can take it for the second v5.13 NFSD PR.

Quoted 4 lines

Thanks
--
Gustavo

Quoted 50 lines
Quoted 49 lines · Gustavo A. R. Silva
Quoted 36 lines · Chuck Lever
Quoted 36 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a couple of break statements instead of just letting the code fall through to the next case.

---
fs/nfsd/nfs4state.c | 1 +
fs/nfsd/nfsctl.c | 1 +

2 files changed, 2 insertions(+)
fs/nfsd/nfs4state.c +1 -0
index d7f27ed6b794..cdab0d5be186 100644
@@ -3113,6 +3113,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 			goto out_nolock;
 		}
 		new->cl_mach_cred = true;
+		break;
 	case SP4_NONE:
 		break;
 	default:				/* checked by xdr code */
fs/nfsd/nfsctl.c +1 -0
index f6d5d783f4a4..9a3bb1e217f9 100644
@@ -1165,6 +1165,7 @@ static struct inode *nfsd_get_inode(struct super_block *sb, umode_t mode)
 		inode->i_fop = &simple_dir_operations;
 		inode->i_op = &simple_dir_inode_operations;
 		inc_nlink(inode);
+		break;
Quoted 8 lines
Quoted 6 lines
fs/nfsd/nfsctl.c +0 -0
 	default:
 		break;
 	}
Signature · 1 line
2.27.0

Thanks, Chuck.
--
Gustavo

--
Chuck Lever

#45 lore raw

PATCH 17/141 nfs: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly add multiple break/goto/return/fallthrough statements instead of just letting the code fall through to the next case.

---
 fs/nfs/nfs3acl.c    | 1 +
 fs/nfs/nfs4client.c | 1 +
 fs/nfs/nfs4proc.c   | 2 ++
 fs/nfs/nfs4state.c  | 1 +
 fs/nfs/pnfs.c       | 2 ++
 5 files changed, 7 insertions(+)
fs/nfs/nfs3acl.c +1 -0
index c6c863382f37..68e206cf4c4e 100644
@@ -111,6 +111,7 @@ struct posix_acl *nfs3_get_acl(struct inode *inode, int type)
 			fallthrough;
 		case -ENOTSUPP:
 			status = -EOPNOTSUPP;
+			goto getout;
 		default:
 			goto getout;
 	}
fs/nfs/nfs4client.c +1 -0
index be7915c861ce..4bdd256b725a 100644
@@ -609,6 +609,7 @@ int nfs40_walk_client_list(struct nfs_client *new,
 			 * changed. Schedule recovery!
 			 */
 			nfs4_schedule_path_down_recovery(pos);
+			goto out;
 		default:
 			goto out;
 		}
fs/nfs/nfs4proc.c +2 -0
index 9e0ca9b2b210..98c9f3197647 100644
@@ -2229,6 +2229,7 @@ static int nfs4_handle_delegation_recall_error(struct nfs_server *server, struct
 		default:
 			printk(KERN_ERR "NFS: %s: unhandled error "
 					"%d.\n", __func__, err);
+			fallthrough;
 		case 0:
 		case -ENOENT:
 		case -EAGAIN:
@@ -9698,6 +9699,7 @@ nfs4_layoutcommit_done(struct rpc_task *task, void *calldata)
 	case -NFS4ERR_BADLAYOUT:     /* no layout */
 	case -NFS4ERR_GRACE:	    /* loca_recalim always false */
 		task->tk_status = 0;
+		break;
 	case 0:
 		break;
 	default:
fs/nfs/nfs4state.c +1 -0
index 4bf10792cb5b..3a51351bdc6a 100644
@@ -1125,6 +1125,7 @@ static void nfs_increment_seqid(int status, struct nfs_seqid *seqid)
 					" sequence-id error on an"
 					" unconfirmed sequence %p!\n",
 					seqid->sequence);
+			return;
 		case -NFS4ERR_STALE_CLIENTID:
 		case -NFS4ERR_STALE_STATEID:
 		case -NFS4ERR_BAD_STATEID:
fs/nfs/pnfs.c +2 -0
index 0e50b9d45c32..7f71f4f8347f 100644
@@ -2824,6 +2824,7 @@ pnfs_do_write(struct nfs_pageio_descriptor *desc,
 	switch (trypnfs) {
 	case PNFS_NOT_ATTEMPTED:
 		pnfs_write_through_mds(desc, hdr);
+		break;
 	case PNFS_ATTEMPTED:
 		break;
 	case PNFS_TRY_AGAIN:
@@ -2968,6 +2969,7 @@ pnfs_do_read(struct nfs_pageio_descriptor *desc, struct nfs_pgio_header *hdr)
 	switch (trypnfs) {
 	case PNFS_NOT_ATTEMPTED:
 		pnfs_read_through_mds(desc, hdr);
+		break;
 	case PNFS_ATTEMPTED:
 		break;
 	case PNFS_TRY_AGAIN:
Signature · 1 line
2.27.0
#46 lore raw

PATCH 18/141 qed: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a couple of break statements instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/qlogic/qed/qed_l2.c    | 1 +
 drivers/net/ethernet/qlogic/qed/qed_sriov.c | 1 +
 2 files changed, 2 insertions(+)
drivers/net/ethernet/qlogic/qed/qed_l2.c +1 -0
index 07824bf9d68d..dfaf10edfabf 100644
@@ -396,6 +396,7 @@ int qed_sp_eth_vport_start(struct qed_hwfn *p_hwfn,
 		tpa_param->tpa_ipv6_en_flg = 1;
 		tpa_param->tpa_pkt_split_flg = 1;
 		tpa_param->tpa_gro_consistent_flg = 1;
+		break;
 	default:
 		break;
 	}
drivers/net/ethernet/qlogic/qed/qed_sriov.c +1 -0
index b8dc5c4591ef..ed2b6fe5a78d 100644
@@ -4734,6 +4734,7 @@ void qed_inform_vf_link_state(struct qed_hwfn *hwfn)
 			 */
 			link.speed = (hwfn->cdev->num_hwfns > 1) ?
 				     100000 : 40000;
+			break;
 		default:
 			/* In auto mode pass PF link image to VF */
 			break;
Signature · 1 line
2.27.0
Reviewed-by on v1 18/141
#47 lore raw

Re: [EXT] [PATCH 018/141] qed: Fix fall-through warnings for Clang

Quoted 7 lines · Gustavo A. R. Silva

External Email

----------------------------------------------------------------------
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a couple of break statements instead of just letting the code fall through to the next case.

Quoted 6 lines

Link:
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_KSPP_linux
_issues_115&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=GtqbaEwqFLiM6BiwNMdKmpXb5o up1VLiSIroUNQwbYA&m=6E7IvGvqcEGj8wEOVoN1BySZhGUVECVTBJCmNiRsHUw&s=J1SWrfEL erJOzUlJdD_S5afGaZosmVP8lyKsu9DTULw&e=

Thanks,
Igor

#48 lore raw

Re: [EXT] [PATCH 018/141] qed: Fix fall-through warnings for Clang

Quoted 10 lines · Igor Russkikh
Quoted 7 lines · Gustavo A. R. Silva

External Email

----------------------------------------------------------------------
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a couple of break statements instead of just letting the code fall through to the next case.

Quoted 8 lines
Quoted 6 lines

Link:
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_KSPP_linux
_issues_115&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=GtqbaEwqFLiM6BiwNMdKmpXb5o up1VLiSIroUNQwbYA&m=6E7IvGvqcEGj8wEOVoN1BySZhGUVECVTBJCmNiRsHUw&s=J1SWrfEL erJOzUlJdD_S5afGaZosmVP8lyKsu9DTULw&e=

Thanks, Igor.
--
Gustavo

#49 lore raw

PATCH 19/141 qlcnic: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a break and a goto statements instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c   | 1 +
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 1 +
 2 files changed, 2 insertions(+)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +1 -0
index bdf15d2a6431..af4c516a9e7c 100644
@@ -1390,6 +1390,7 @@ static int qlcnic_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring, int ma
 			break;
 		case QLCNIC_RESPONSE_DESC:
 			qlcnic_handle_fw_message(desc_cnt, consumer, sds_ring);
+			goto skip;
 		default:
 			goto skip;
 		}
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +1 -0
index 5a7e240fd469..3abbd22e2ed3 100644
@@ -3456,6 +3456,7 @@ qlcnic_fwinit_work(struct work_struct *work)
 			adapter->fw_wait_cnt = 0;
 			return;
 		}
+		break;
 	case QLCNIC_DEV_FAILED:
 		break;
 	default:
Signature · 1 line
2.27.0
#50 lore raw

PATCH 20/141 scsi: aic7xxx: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case, and by adding fallthrough statements in places where the code is intended to fall through, and finally by replacing /* FALLTHROUGH */ comments with the new pseudo-keyword macro fallthrough.

---
 drivers/scsi/aic7xxx/aic79xx_core.c | 4 +++-
 drivers/scsi/aic7xxx/aic7xxx_core.c | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/scsi/aic7xxx/aic79xx_core.c +3 -1
index 98b02e7d38bb..dd8d6646b06f 100644
@@ -6130,6 +6130,7 @@ ahd_free(struct ahd_softc *ahd)
 		fallthrough;
 	case 2:
 		ahd_dma_tag_destroy(ahd, ahd->shared_data_dmat);
+		break;
 	case 1:
 		break;
 	case 0:
@@ -6542,8 +6543,8 @@ ahd_fini_scbdata(struct ahd_softc *ahd)
 			kfree(hscb_map);
 		}
 		ahd_dma_tag_destroy(ahd, scb_data->hscb_dmat);
-		/* FALLTHROUGH */
 	}
+		fallthrough;
 	case 4:
 	case 3:
 	case 2:
@@ -8911,6 +8912,7 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb)
 					break;
 				case SIU_PFC_ILLEGAL_REQUEST:
 					printk("Illegal request\n");
+					break;
 				default:
 					break;
 				}
drivers/scsi/aic7xxx/aic7xxx_core.c +2 -2
index 725bb7f58054..2df664e3e954 100644
@@ -4478,6 +4478,7 @@ ahc_free(struct ahc_softc *ahc)
 		fallthrough;
 	case 2:
 		ahc_dma_tag_destroy(ahc, ahc->shared_data_dmat);
+		fallthrough;
 	case 1:
 		break;
 	case 0:
@@ -5867,9 +5868,8 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, char channel,
 				if ((scb->flags & SCB_ACTIVE) == 0)
 					printk("Inactive SCB in qinfifo\n");
 				ahc_done(ahc, scb);
-
-				/* FALLTHROUGH */
 			}
+				fallthrough;
 			case SEARCH_REMOVE:
 				break;
 			case SEARCH_COUNT:
Signature · 1 line
2.27.0
#51 lore raw

PATCH 21/141 scsi: aic94xx: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a couple of break and fallthrough statements instead of just letting the code fall through to the next case.

---
 drivers/scsi/aic94xx/aic94xx_scb.c  | 2 ++
 drivers/scsi/aic94xx/aic94xx_task.c | 2 ++
 2 files changed, 4 insertions(+)
drivers/scsi/aic94xx/aic94xx_scb.c +2 -0
index e2d880a5f391..13677973da5c 100644
@@ -721,6 +721,7 @@ static void set_speed_mask(u8 *speed_mask, struct asd_phy_desc *pd)
 		fallthrough;
 	case SAS_LINK_RATE_3_0_GBPS:
 		*speed_mask |= SAS_SPEED_15_DIS;
+		fallthrough;
 	default:
 	case SAS_LINK_RATE_1_5_GBPS:
 		/* nothing to do */
@@ -739,6 +740,7 @@ static void set_speed_mask(u8 *speed_mask, struct asd_phy_desc *pd)
 	switch (pd->min_sata_lrate) {
 	case SAS_LINK_RATE_3_0_GBPS:
 		*speed_mask |= SATA_SPEED_15_DIS;
+		fallthrough;
 	default:
 	case SAS_LINK_RATE_1_5_GBPS:
 		/* nothing to do */
drivers/scsi/aic94xx/aic94xx_task.c +2 -0
index f923ed019d4a..3d345057ede6 100644
@@ -316,6 +316,7 @@ static void asd_task_tasklet_complete(struct asd_ascb *ascb,
 		break;
 	case SAS_PROTOCOL_SSP:
 		asd_unbuild_ssp_ascb(ascb);
+		break;
 	default:
 		break;
 	}
@@ -610,6 +611,7 @@ int asd_execute_task(struct sas_task *task, gfp_t gfp_flags)
 				break;
 			case SAS_PROTOCOL_SSP:
 				asd_unbuild_ssp_ascb(a);
+				break;
 			default:
 				break;
 			}
Signature · 1 line
2.27.0
#52 lore raw

PATCH 22/141 scsi: bfa: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a couple break statements and replacing /* fall through */ comments with the new pseudo-keyword macro fallthrough; instead of just letting the code fall through to the next case.

Notice that Clang doesn't recognize /* fall through */ comments as implicit fall-through markings.

---
 drivers/scsi/bfa/bfa_fcs_lport.c | 2 +-
 drivers/scsi/bfa/bfa_ioc.c       | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/scsi/bfa/bfa_fcs_lport.c +1 -1
index 3486e402bfc1..49a14157f123 100644
@@ -5671,7 +5671,7 @@ bfa_fcs_lport_scn_process_rscn(struct bfa_fcs_lport_s *port,
 				bfa_fcs_lport_ms_fabric_rscn(port);
 				break;
 			}
-			/* !!!!!!!!! Fall Through !!!!!!!!!!!!! */
+			fallthrough;
 
 		case FC_RSCN_FORMAT_AREA:
 		case FC_RSCN_FORMAT_DOMAIN:
drivers/scsi/bfa/bfa_ioc.c +4 -2
index 325ad8a592bb..5740302d83ac 100644
@@ -387,7 +387,7 @@ bfa_ioc_sm_getattr(struct bfa_ioc_s *ioc, enum ioc_event event)
 	case IOC_E_PFFAILED:
 	case IOC_E_HWERROR:
 		bfa_ioc_timer_stop(ioc);
-		/* !!! fall through !!! */
+		fallthrough;
 	case IOC_E_TIMEOUT:
 		ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE);
 		bfa_fsm_set_state(ioc, bfa_ioc_sm_fail);
@@ -437,7 +437,7 @@ bfa_ioc_sm_op(struct bfa_ioc_s *ioc, enum ioc_event event)
 	case IOC_E_PFFAILED:
 	case IOC_E_HWERROR:
 		bfa_hb_timer_stop(ioc);
-		/* !!! fall through !!! */
+		fallthrough;
 	case IOC_E_HBFAIL:
 		if (ioc->iocpf.auto_recover)
 			bfa_fsm_set_state(ioc, bfa_ioc_sm_fail_retry);
@@ -3299,6 +3299,7 @@ bfa_ablk_isr(void *cbarg, struct bfi_mbmsg_s *msg)
 	case BFI_ABLK_I2H_PORT_CONFIG:
 		/* update config port mode */
 		ablk->ioc->port_mode_cfg = rsp->port_mode;
+		break;
 
 	case BFI_ABLK_I2H_PF_DELETE:
 	case BFI_ABLK_I2H_PF_UPDATE:
@@ -5871,6 +5872,7 @@ bfa_dconf_sm_uninit(struct bfa_dconf_mod_s *dconf, enum bfa_dconf_event event)
 		break;
 	case BFA_DCONF_SM_EXIT:
 		bfa_fsm_send_event(&dconf->bfa->iocfc, IOCFC_E_DCONF_DONE);
+		break;
 	case BFA_DCONF_SM_IOCDISABLE:
 	case BFA_DCONF_SM_WR:
 	case BFA_DCONF_SM_FLASH_COMP:
Signature · 1 line
2.27.0
#53 lore raw

PATCH 23/141 staging: rtl8723bs: core: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

---
 drivers/staging/rtl8723bs/core/rtw_cmd.c       | 1 +
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c  | 1 +
 drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 1 +
 3 files changed, 3 insertions(+)
drivers/staging/rtl8723bs/core/rtw_cmd.c +1 -0
index 2abe205e3453..232661e6a5c9 100644
@@ -1487,6 +1487,7 @@ void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type)
 		break;
 	case LPS_CTRL_TRAFFIC_BUSY:
 		LPS_Leave(padapter, "LPS_CTRL_TRAFFIC_BUSY");
+		break;
 	default:
 		break;
 	}
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +1 -0
index b912ad2f4b72..ea44d653a591 100644
@@ -1708,6 +1708,7 @@ unsigned int OnAssocRsp(struct adapter *padapter, union recv_frame *precv_frame)
 
 		case _ERPINFO_IE_:
 			ERP_IE_handler(padapter, pIE);
+			break;
 
 		default:
 			break;
drivers/staging/rtl8723bs/core/rtw_wlan_util.c +1 -0
index 372ce17c3569..2b13c683ba5c 100644
@@ -1505,6 +1505,7 @@ unsigned int is_ap_in_tkip(struct adapter *padapter)
 			case _RSN_IE_2_:
 				if (!memcmp((pIE->data + 8), RSN_TKIP_CIPHER, 4))
 					return true;
+				break;
 
 			default:
 				break;
Signature · 1 line
2.27.0
#54 lore raw

PATCH 24/141 staging: vt6655: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

---
 drivers/staging/vt6655/device_main.c | 1 +
 drivers/staging/vt6655/rxtx.c        | 2 ++
 2 files changed, 3 insertions(+)
drivers/staging/vt6655/device_main.c +1 -0
index 09ab6d6f2429..0adbd2b67df0 100644
@@ -1579,6 +1579,7 @@ static int vnt_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	case DISABLE_KEY:
 		if (test_bit(key->hw_key_idx, &priv->key_entry_inuse))
 			clear_bit(key->hw_key_idx, &priv->key_entry_inuse);
+		break;
 	default:
 		break;
 	}
drivers/staging/vt6655/rxtx.c +2 -0
index 477d19314634..1a64152de189 100644
@@ -1004,6 +1004,7 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
 		switch (info->control.hw_key->cipher) {
 		case WLAN_CIPHER_SUITE_CCMP:
 			cbMICHDR = sizeof(struct vnt_mic_hdr);
+			break;
 		default:
 			break;
 		}
@@ -1318,6 +1319,7 @@ int vnt_generate_fifo_header(struct vnt_private *priv, u32 dma_idx,
 			break;
 		case WLAN_CIPHER_SUITE_CCMP:
 			tx_buffer_head->frag_ctl |= cpu_to_le16(FRAGCTL_AES);
+			break;
 		default:
 			break;
 		}
Signature · 1 line
2.27.0
#55 lore raw

PATCH 25/141 bnxt_en: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -0
index 7975f59735d6..b593237915e3 100644
@@ -2137,6 +2137,7 @@ static int bnxt_hwrm_handler(struct bnxt *bp, struct tx_cmp *txcmp)
 	case CMPL_BASE_TYPE_HWRM_ASYNC_EVENT:
 		bnxt_async_event_process(bp,
 					 (struct hwrm_async_event_cmpl *)txcmp);
+		break;
 
 	default:
 		break;
Signature · 1 line
2.27.0
#56 lore raw

PATCH 26/141 ceph: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a break and a goto statements instead of just letting the code fall through to the next case.

---
 fs/ceph/dir.c | 2 ++
 1 file changed, 2 insertions(+)
fs/ceph/dir.c +2 -0
index a4d48370b2b3..e9b44f613932 100644
@@ -631,10 +631,12 @@ static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int whence)
 	switch (whence) {
 	case SEEK_CUR:
 		offset += file->f_pos;
+		break;
 	case SEEK_SET:
 		break;
 	case SEEK_END:
 		retval = -EOPNOTSUPP;
+		goto out;
 	default:
 		goto out;
 	}
Signature · 1 line
2.27.0
#57 lore raw

PATCH 27/141 drbd: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a break statement instead of just letting the code fall through to the next, and by adding a fallthrough pseudo-keyword in places whre the code is intended to fall through.

---
 drivers/block/drbd/drbd_receiver.c | 1 +
 drivers/block/drbd/drbd_req.c      | 1 +
 2 files changed, 2 insertions(+)
drivers/block/drbd/drbd_receiver.c +1 -0
index dc333dbe5232..c19bb74ac935 100644
@@ -5863,6 +5863,7 @@ static int got_NegRSDReply(struct drbd_connection *connection, struct packet_inf
 		switch (pi->cmd) {
 		case P_NEG_RS_DREPLY:
 			drbd_rs_failed_io(device, sector, size);
+			break;
 		case P_RS_CANCEL:
 			break;
 		default:
drivers/block/drbd/drbd_req.c +1 -0
index 330f851cb8f0..9f212a923a3c 100644
@@ -750,6 +750,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
 
 	case WRITE_ACKED_BY_PEER_AND_SIS:
 		req->rq_state |= RQ_NET_SIS;
+		fallthrough;
 	case WRITE_ACKED_BY_PEER:
 		/* Normal operation protocol C: successfully written on peer.
 		 * During resync, even in protocol != C,
Signature · 1 line
2.27.0
#58 lore raw

Re: [PATCH 027/141] drbd: Fix fall-through warnings for Clang

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 37 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a break statement instead of just letting the code fall through to the next, and by adding a fallthrough pseudo-keyword in places whre the code is intended to fall through.

---
 drivers/block/drbd/drbd_receiver.c | 1 +
 drivers/block/drbd/drbd_req.c      | 1 +
 2 files changed, 2 insertions(+)
drivers/block/drbd/drbd_receiver.c +1 -0
index dc333dbe5232..c19bb74ac935 100644
@@ -5863,6 +5863,7 @@ static int got_NegRSDReply(struct drbd_connection *connection, struct packet_inf
 		switch (pi->cmd) {
 		case P_NEG_RS_DREPLY:
 			drbd_rs_failed_io(device, sector, size);
+			break;
 		case P_RS_CANCEL:
 			break;
 		default:
drivers/block/drbd/drbd_req.c +1 -0
index 330f851cb8f0..9f212a923a3c 100644
@@ -750,6 +750,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
 
 	case WRITE_ACKED_BY_PEER_AND_SIS:
 		req->rq_state |= RQ_NET_SIS;
+		fallthrough;
 	case WRITE_ACKED_BY_PEER:
 		/* Normal operation protocol C: successfully written on peer.
 		 * During resync, even in protocol != C,
maintainer Applied
#59 lore raw

Re: [PATCH 027/141] drbd: Fix fall-through warnings for Clang

Quoted 3 lines · Gustavo A. R. Silva

Hi all,

Friendly ping: who can take this, please?

Applied, thanks.

Signature · 1 line
Jens Axboe
#60 lore raw

Re: [PATCH 027/141] drbd: Fix fall-through warnings for Clang

Quoted 1 line · Jens Axboe

Applied, thanks.

Awesome. :)

Thanks
--
Gustavo

#61 lore raw

PATCH 28/141 drm/amd/display: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

---
 drivers/gpu/drm/amd/display/dc/bios/bios_parser.c  | 1 +
 drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 2 ++
 drivers/gpu/drm/amd/display/dc/core/dc_link.c      | 1 +
 3 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +1 -0
index ad394aefa5d9..23a373ca94b5 100644
@@ -1198,6 +1198,7 @@ static enum bp_result bios_parser_get_embedded_panel_info(
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +2 -0
index 29d64e7e304f..fd1e64fa8744 100644
@@ -903,6 +903,7 @@ static enum bp_result bios_parser_get_soc_bb_info(
 			break;
 		case 4:
 			result = get_soc_bb_info_v4_4(bp, soc_bb_info);
+			break;
 		default:
 			break;
 		}
@@ -1019,6 +1020,7 @@ static enum bp_result bios_parser_get_embedded_panel_info(
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -0
index fec87a2e210c..b9254a87ee73 100644
@@ -1052,6 +1052,7 @@ static bool dc_link_detect_helper(struct dc_link *link,
 
 				return false;
 			}
+			break;
 		default:
 			break;
 		}
Signature · 6 lines
2.27.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Applied
#62 lore raw

Re: [PATCH 028/141] drm/amd/display: Fix fall-through warnings for Clang

Quoted 7 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

Applied. Thanks!

Alex

Quoted 57 lines
---
 drivers/gpu/drm/amd/display/dc/bios/bios_parser.c  | 1 +
 drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 2 ++
 drivers/gpu/drm/amd/display/dc/core/dc_link.c      | 1 +
 3 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +1 -0
index ad394aefa5d9..23a373ca94b5 100644
@@ -1198,6 +1198,7 @@ static enum bp_result bios_parser_get_embedded_panel_info(
                default:
                        break;
                }
+               break;
        default:
                break;
        }
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +2 -0
index 29d64e7e304f..fd1e64fa8744 100644
@@ -903,6 +903,7 @@ static enum bp_result bios_parser_get_soc_bb_info(
                        break;
                case 4:
                        result = get_soc_bb_info_v4_4(bp, soc_bb_info);
+                       break;
                default:
                        break;
                }
@@ -1019,6 +1020,7 @@ static enum bp_result bios_parser_get_embedded_panel_info(
                default:
                        break;
                }
+               break;
        default:
                break;
        }
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
index fec87a2e210c..b9254a87ee73 100644
@@ -1052,6 +1052,7 @@ static bool dc_link_detect_helper(struct dc_link *link,
 
                                return false;
                        }
+                       break;
                default:
                        break;
                }
--

2.27.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#63 lore raw

Re: [PATCH 028/141] drm/amd/display: Fix fall-through warnings for Clang

Quoted 11 lines · Alex Deucher
Quoted 7 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.

Applied. Thanks!

Thanks, Alex.
--
Gustavo
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#64 lore raw

PATCH 29/141 e1000: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/intel/e1000/e1000_hw.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/e1000/e1000_hw.c +1 -0
index 4c0c9433bd60..19cf36360933 100644
@@ -1183,6 +1183,7 @@ static s32 e1000_copper_link_igp_setup(struct e1000_hw *hw)
 			break;
 		case e1000_ms_auto:
 			phy_data &= ~CR_1000T_MS_ENABLE;
+			break;
 		default:
 			break;
 		}
Signature · 1 line
2.27.0
#65 lore raw

PATCH 30/141 ext2: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 fs/ext2/inode.c | 1 +
 1 file changed, 1 insertion(+)
fs/ext2/inode.c +1 -0
index 11c5c6fe75bb..78c417d3c898 100644
@@ -1256,6 +1256,7 @@ static void __ext2_truncate_blocks(struct inode *inode, loff_t offset)
 				mark_inode_dirty(inode);
 				ext2_free_branches(inode, &nr, &nr+1, 3);
 			}
+			break;
 		case EXT2_TIND_BLOCK:
 			;
 	}
Signature · 1 line
2.27.0
maintainer
#66 lore raw

Re: [PATCH 030/141] ext2: Fix fall-through warnings for Clang

Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

Thanks. Applied.

Honza

Quoted 19 lines
---
 fs/ext2/inode.c | 1 +
 1 file changed, 1 insertion(+)
fs/ext2/inode.c +1 -0
index 11c5c6fe75bb..78c417d3c898 100644
@@ -1256,6 +1256,7 @@ static void __ext2_truncate_blocks(struct inode *inode, loff_t offset)
 				mark_inode_dirty(inode);
 				ext2_free_branches(inode, &nr, &nr+1, 3);
 			}
+			break;
 		case EXT2_TIND_BLOCK:
 			;
 	}
Signature · 1 line
2.27.0
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
#68 lore raw
In reply to Gustavo A. R. Silva
Quoted 5 lines · Gustavo A. R. Silva

Hi all,

This series aims to fix almost all remaining fall-through warnings in order to enable -Wimplicit-fallthrough for Clang.

Quoted 7 lines

In preparation to enable -Wimplicit-fallthrough for Clang, explicitly add multiple break/goto/return/fallthrough statements instead of just letting the code fall through to the next case.

Notice that in order to enable -Wimplicit-fallthrough for Clang, this change[1] is meant to be reverted at some point. So, this patch helps to move in that direction.

This was a bit hard to parse for a second or three.

Thanks Gustavo.

How was this change done?

#69 lore raw
Quoted 14 lines · Joe Perches
Quoted 5 lines · Gustavo A. R. Silva

Hi all,

This series aims to fix almost all remaining fall-through warnings in order to enable -Wimplicit-fallthrough for Clang.

Quoted 7 lines

In preparation to enable -Wimplicit-fallthrough for Clang, explicitly add multiple break/goto/return/fallthrough statements instead of just letting the code fall through to the next case.

Notice that in order to enable -Wimplicit-fallthrough for Clang, this change[1] is meant to be reverted at some point. So, this patch helps to move in that direction.

Quoted 5 lines

This was a bit hard to parse for a second or three.

Thanks Gustavo.

How was this change done?

I audited case by case in order to determine the best fit for each situation. Depending on the surrounding logic, sometimes it makes more sense a goto or a fallthrough rather than merely a break.

Thanks
--
Gustavo

#70 lore raw

PATCH 31/141 ext4: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 fs/ext4/super.c | 1 +
 1 file changed, 1 insertion(+)
fs/ext4/super.c +1 -0
index 6633b20224d5..ca04389fc718 100644
@@ -4877,6 +4877,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 			       "requested data journaling mode");
 			goto failed_mount_wq;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#72 lore raw

PATCH 32/141 floppy: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword in places where the code is intended to fall through to the next case.

---
 drivers/block/floppy.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/floppy.c +1 -0
index 7df79ae6b0a1..21a2a7becba0 100644
@@ -2124,6 +2124,7 @@ static void format_interrupt(void)
 	switch (interpret_errors()) {
 	case 1:
 		cont->error();
+		fallthrough;
 	case 2:
 		break;
 	case 0:
Signature · 1 line
2.27.0
#73 lore raw

Re: [PATCH 032/141] floppy: Fix fall-through warnings for Clang

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 23 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword in places where the code is intended to fall through to the next case.

---
 drivers/block/floppy.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/floppy.c +1 -0
index 7df79ae6b0a1..21a2a7becba0 100644
@@ -2124,6 +2124,7 @@ static void format_interrupt(void)
 	switch (interpret_errors()) {
 	case 1:
 		cont->error();
+		fallthrough;
 	case 2:
 		break;
 	case 0:
maintainer
#74 lore raw

Re: [PATCH 032/141] floppy: Fix fall-through warnings for Clang

Quoted 19 lines · Gustavo A. R. Silva

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 10 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword in places where the code is intended to fall through to the next case.

---
 drivers/block/floppy.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 12 lines

drivers/block/floppy.c static void format_interrupt(void) · line 2130

Quoted 12 lines
drivers/block/floppy.c +1 -0
index 7df79ae6b0a1..21a2a7becba0 100644
@@ -2124,6 +2124,7 @@ static void format_interrupt(void)
 	switch (interpret_errors()) {
 	case 1:
 		cont->error();
+		fallthrough;
 	case 2:
 		break;
 	case 0:

I wonder about the consistency of the patches. The one I just applied for libata adds a break, this one annotates fallthrough. But the cases are really 100% the same. Why aren't the changes consistent? Both are obviously fine, but for identical cases it seems odd that they differ.

IMHO, adding a break makes more sense. Annotate the fallthrough if the two cases share work that needs to be done, as then that solution makes sense.

Signature · 1 line
Jens Axboe
#75 lore raw

Re: [PATCH 032/141] floppy: Fix fall-through warnings for Clang

Quoted 19 lines · Jens Axboe
Quoted 13 lines

drivers/block/floppy.c static void format_interrupt(void) · line 2130

Quoted 13 lines
drivers/block/floppy.c +1 -0
index 7df79ae6b0a1..21a2a7becba0 100644
@@ -2124,6 +2124,7 @@ static void format_interrupt(void)
 	switch (interpret_errors()) {
 	case 1:
 		cont->error();
+		fallthrough;
 	case 2:
 		break;
 	case 0:

I wonder about the consistency of the patches. The one I just applied for libata adds a break, this one annotates fallthrough. But the cases are really 100% the same. Why aren't the changes consistent? Both are obviously fine, but for identical cases it seems odd that they differ.

Quoted 4 lines

IMHO, adding a break makes more sense. Annotate the fallthrough if the two cases share work that needs to be done, as then that solution makes sense.

Yeah; I'll resend this with a break, instead.

Thanks for the feedback.
--
Gustavo

maintainer
#76 lore raw

Re: [PATCH 032/141] floppy: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

Hi,

Sorry, this was missed somehow.

I would rewrite it to something more simple instead of adding fallthrough.

What about?

drivers/block/floppy.c +4 -2
@@ -2123,12 +2123,14 @@ static void set_floppy(int drive)
 static void format_interrupt(void)
 {
        switch (interpret_errors()) {
+       case 0:
+               cont->done(1);
+               break;
        case 1:
                cont->error();
+               break;
        case 2:
                break;
-       case 0:
-               cont->done(1);
        }
        cont->redo();
 }
Quoted 32 lines · Gustavo A. R. Silva

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 23 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword in places where the code is intended to fall through to the next case.

---
 drivers/block/floppy.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/floppy.c +1 -0
index 7df79ae6b0a1..21a2a7becba0 100644
@@ -2124,6 +2124,7 @@ static void format_interrupt(void)
 	switch (interpret_errors()) {
 	case 1:
 		cont->error();
+		fallthrough;
 	case 2:
 		break;
 	case 0:
#77 lore raw

PATCH 33/141 fm10k: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding a couple of break statements instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/intel/fm10k/fm10k_mbx.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/fm10k/fm10k_mbx.c +2 -0
index 8e2e92bf3cd4..3e970e20695d 100644
@@ -1039,6 +1039,7 @@ static s32 fm10k_mbx_create_reply(struct fm10k_hw *hw,
 	case FM10K_STATE_CLOSED:
 		/* generate new header based on data */
 		fm10k_mbx_create_disconnect_hdr(mbx);
+		break;
 	default:
 		break;
 	}
@@ -2017,6 +2018,7 @@ static s32 fm10k_sm_mbx_process_reset(struct fm10k_hw *hw,
 	case FM10K_STATE_CONNECT:
 		/* Update remote value to match local value */
 		mbx->remote = mbx->local;
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#78 lore raw

PATCH 34/141 IB/mlx4: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 drivers/infiniband/hw/mlx4/mad.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/hw/mlx4/mad.c +1 -0
index 8bd16474708f..f3ace85552f3 100644
@@ -1523,6 +1523,7 @@ static void mlx4_ib_multiplex_mad(struct mlx4_ib_demux_pv_ctx *ctx, struct ib_wc
 			return;
 		} else
 			*slave_id = slave;
+		break;
 	default:
 		/* nothing */;
 	}
Signature · 1 line
2.27.0
#79 lore raw

PATCH 35/141 IB/qedr: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 drivers/infiniband/hw/qedr/main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/hw/qedr/main.c +1 -0
index 967641662b24..10707b451ab8 100644
@@ -796,6 +796,7 @@ static void qedr_affiliated_event(void *context, u8 e_code, void *fw_handle)
 		}
 		xa_unlock_irqrestore(&dev->srqs, flags);
 		DP_NOTICE(dev, "SRQ event %d on handle %p\n", e_code, srq);
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
maintainer Acked-by on v1 35/141
#80 lore raw

RE: [EXT] [PATCH 035/141] IB/qedr: Fix fall-through warnings for Clang

Quoted 34 lines

From: Gustavo A. R. Silva <[email protected]>
Sent: Friday, November 20, 2020 8:29 PM

----------------------------------------------------------------------
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

3A__github.com_KSPP_linux_issues_115&d=DwIBAg&c=nKjWec2b6R0mOyP az7xtfQ&r=5_8rRZTDuAS-6X-cGRU9Fo4yjCnkS1t7T3- gjL4FQng&m=ZJjyam8OGRTmM8iCzOSDOL7dMn31Pmw3aA- QOVDY8eg&s=4rQYW1K3xAzeRV7SRkrvaivRWz2WwEuuk0ZnjnDTA1w&e=

---
 drivers/infiniband/hw/qedr/main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/hw/qedr/main.c +1 -0
index 967641662b24..10707b451ab8 100644
@@ -796,6 +796,7 @@ static void qedr_affiliated_event(void *context, u8
 e_code, void *fw_handle)
 		}
 		xa_unlock_irqrestore(&dev->srqs, flags);
 		DP_NOTICE(dev, "SRQ event %d on handle %p\n", e_code,
 srq);
+		break;
 	default:
drivers/infiniband/hw/qedr/main.c +0 -1
 		break;
 	}
--
Quoted 1 line

2.27.0

Thanks,

#81 lore raw

Re: [EXT] [PATCH 035/141] IB/qedr: Fix fall-through warnings for Clang

Quoted 38 lines · Michal Kalderon
Quoted 34 lines

From: Gustavo A. R. Silva <[email protected]>
Sent: Friday, November 20, 2020 8:29 PM

----------------------------------------------------------------------
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

3A__github.com_KSPP_linux_issues_115&d=DwIBAg&c=nKjWec2b6R0mOyP az7xtfQ&r=5_8rRZTDuAS-6X-cGRU9Fo4yjCnkS1t7T3- gjL4FQng&m=ZJjyam8OGRTmM8iCzOSDOL7dMn31Pmw3aA- QOVDY8eg&s=4rQYW1K3xAzeRV7SRkrvaivRWz2WwEuuk0ZnjnDTA1w&e=

---
 drivers/infiniband/hw/qedr/main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/hw/qedr/main.c +1 -0
index 967641662b24..10707b451ab8 100644
@@ -796,6 +796,7 @@ static void qedr_affiliated_event(void *context, u8
 e_code, void *fw_handle)
 		}
 		xa_unlock_irqrestore(&dev->srqs, flags);
 		DP_NOTICE(dev, "SRQ event %d on handle %p\n", e_code,
 srq);
+		break;
 	default:
drivers/infiniband/hw/qedr/main.c +0 -1
 		break;
 	}
--
Quoted 1 line

2.27.0

Thanks,

Quoted 1 line

Thanks, Michal.
--
Gustavo

#82 lore raw

PATCH 36/141 ice: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/ice/ice_txrx_lib.c +1 -0
index bc2f4390b51d..c7b47ad36416 100644
@@ -143,6 +143,7 @@ ice_rx_csum(struct ice_ring *ring, struct sk_buff *skb,
 	case ICE_RX_PTYPE_INNER_PROT_UDP:
 	case ICE_RX_PTYPE_INNER_PROT_SCTP:
 		skb->ip_summed = CHECKSUM_UNNECESSARY;
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#83 lore raw

PATCH 37/141 Input: pcspkr - Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 drivers/input/misc/pcspkr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/input/misc/pcspkr.c +1 -0
index e5e0d8ba80e1..9c666b2f14fe 100644
@@ -33,6 +33,7 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type,
 	case SND_BELL:
 		if (value)
 			value = 1000;
+		break;
 	case SND_TONE:
 		break;
 	default:
Signature · 1 line
2.27.0
#85 lore raw

Re: [PATCH 037/141] Input: pcspkr - Fix fall-through warnings for Clang

Quoted 9 lines · Dmitry Torokhov
Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

Applied, thank you.

Thanks, Dmitry.
--
Gustavo

#86 lore raw

PATCH 38/141 isofs: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 fs/isofs/rock.c | 1 +
 1 file changed, 1 insertion(+)
fs/isofs/rock.c +1 -0
index 94ef92fe806c..4880146babaf 100644
@@ -767,6 +767,7 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
 			rs.cont_extent = isonum_733(rr->u.CE.extent);
 			rs.cont_offset = isonum_733(rr->u.CE.offset);
 			rs.cont_size = isonum_733(rr->u.CE.size);
+			break;
 		default:
 			break;
 		}
Signature · 1 line
2.27.0
#87 lore raw

Re: [PATCH 038/141] isofs: Fix fall-through warnings for Clang

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 23 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 fs/isofs/rock.c | 1 +
 1 file changed, 1 insertion(+)
fs/isofs/rock.c +1 -0
index 94ef92fe806c..4880146babaf 100644
@@ -767,6 +767,7 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
 			rs.cont_extent = isonum_733(rr->u.CE.extent);
 			rs.cont_offset = isonum_733(rr->u.CE.offset);
 			rs.cont_size = isonum_733(rr->u.CE.size);
+			break;
 		default:
 			break;
 		}
#88 lore raw

PATCH 39/141 ixgbevf: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +1 -0
index 82fce27f682b..afab78c51be0 100644
@@ -2639,6 +2639,7 @@ static void ixgbevf_set_num_queues(struct ixgbevf_adapter *adapter)
 			adapter->num_rx_queues = rss;
 			adapter->num_tx_queues = rss;
 			adapter->num_xdp_queues = adapter->xdp_prog ? rss : 0;
+			break;
 		default:
 			break;
 		}
Signature · 1 line
2.27.0
#89 lore raw

PATCH 40/141 kprobes/x86: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 arch/x86/kernel/kprobes/core.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/kprobes/core.c +1 -0
index 547c7abb39f5..983738bc08c0 100644
@@ -864,6 +864,7 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs,
 			p->ainsn.boostable = true;
 			goto no_change;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#90 lore raw

PATCH 41/141 mm: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a break statement instead of just letting the code fall through to the next, and by adding a fallthrough pseudo-keyword in places where the code is intended to fall through.

---
 mm/mm_init.c | 1 +
 mm/vmscan.c  | 1 +
 2 files changed, 2 insertions(+)
mm/mm_init.c +1 -0
index b06a30fbedff..8e02e865cc65 100644
@@ -173,6 +173,7 @@ static int __meminit mm_compute_batch_notifier(struct notifier_block *self,
 	case MEM_ONLINE:
 	case MEM_OFFLINE:
 		mm_compute_batch(sysctl_overcommit_memory);
+		break;
 	default:
 		break;
 	}
mm/vmscan.c +1 -0
index 7b4e31eac2cf..a55c96891549 100644
@@ -1372,6 +1372,7 @@ static unsigned int shrink_page_list(struct list_head *page_list,
 				if (PageDirty(page) || PageWriteback(page))
 					goto keep_locked;
 				mapping = page_mapping(page);
+				fallthrough;
 			case PAGE_CLEAN:
 				; /* try to free the page below */
 			}
Signature · 1 line
2.27.0
#91 lore raw

PATCH 42/141 net: 3c509: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/3com/3c509.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/3com/3c509.c +1 -0
index 667f38c9e4c6..676cdc6900b5 100644
@@ -1052,6 +1052,7 @@ el3_netdev_get_ecmd(struct net_device *dev, struct ethtool_link_ksettings *cmd)
 		break;
 	case 3:
 		cmd->base.port = PORT_BNC;
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#92 lore raw

Re: [PATCH 042/141] net: 3c509: Fix fall-through warnings for Clang

Hi all,

It's been more than 3 months; who can take this, please? :)

Thanks
--
Gustavo

Quoted 25 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/3com/3c509.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/3com/3c509.c +1 -0
index 667f38c9e4c6..676cdc6900b5 100644
@@ -1052,6 +1052,7 @@ el3_netdev_get_ecmd(struct net_device *dev, struct ethtool_link_ksettings *cmd)
 		break;
 	case 3:
 		cmd->base.port = PORT_BNC;
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#93 lore raw

PATCH 43/141 net: cassini: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/sun/cassini.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/sun/cassini.c +1 -0
index 9ff894ba8d3e..54f45d8c79a7 100644
@@ -1599,6 +1599,7 @@ static inline int cas_mdio_link_not_up(struct cas *cp)
 			cas_phy_write(cp, MII_BMCR, val);
 			break;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#94 lore raw

Re: [PATCH 043/141] net: cassini: Fix fall-through warnings for Clang

Hi all,

It's been more than 3 months; who can take this, please? :)

Thanks
--
Gustavo

Quoted 25 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/sun/cassini.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/sun/cassini.c +1 -0
index 9ff894ba8d3e..54f45d8c79a7 100644
@@ -1599,6 +1599,7 @@ static inline int cas_mdio_link_not_up(struct cas *cp)
 			cas_phy_write(cp, MII_BMCR, val);
 			break;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#95 lore raw

PATCH 44/141 net/mlx4: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +1 -0
index 1187ef1375e2..e6b8b8dc7894 100644
@@ -2660,6 +2660,7 @@ int mlx4_FREE_RES_wrapper(struct mlx4_dev *dev, int slave,
 	case RES_XRCD:
 		err = xrcdn_free_res(dev, slave, vhcr->op_modifier, alop,
 				     vhcr->in_param, &vhcr->out_param);
+		break;
 
 	default:
 		break;
Signature · 1 line
2.27.0
Reviewed-by on v1 44/141
#96 lore raw

Re: [PATCH 044/141] net/mlx4: Fix fall-through warnings for Clang

Quoted 16 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
  drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 1 +
  1 file changed, 1 insertion(+)
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +0 -0
index 1187ef1375e2..e6b8b8dc7894 100644

drivers/net/ethernet/mellanox/mlx4/resource_tracker.c int mlx4_FREE_RES_wrapper(struct mlx4_dev *dev, int slave, · line 2666

Quoted 7 lines
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +1 -0
@@ -2660,6 +2660,7 @@ int mlx4_FREE_RES_wrapper(struct mlx4_dev *dev, int slave,
  	case RES_XRCD:
  		err = xrcdn_free_res(dev, slave, vhcr->op_modifier, alop,
  				     vhcr->in_param, &vhcr->out_param);
+		break;
 
  	default:
  		break;

Thanks for your patch.

#97 lore raw

Re: [PATCH 044/141] net/mlx4: Fix fall-through warnings for Clang

Quoted 28 lines · Tariq Toukan
Quoted 15 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
  drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 1 +
  1 file changed, 1 insertion(+)
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +0 -0
index 1187ef1375e2..e6b8b8dc7894 100644

drivers/net/ethernet/mellanox/mlx4/resource_tracker.c int mlx4_FREE_RES_wrapper(struct mlx4_dev *dev, int slave, · line 2666

Quoted 7 lines
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +1 -0
@@ -2660,6 +2660,7 @@ int mlx4_FREE_RES_wrapper(struct mlx4_dev *dev, int slave,
  	case RES_XRCD:
  		err = xrcdn_free_res(dev, slave, vhcr->op_modifier, alop,
  				     vhcr->in_param, &vhcr->out_param);
+		break;
  	default:
  		break;
 
Quoted 1 line

Thanks for your patch.

Thanks, Tariq.
--
Gustavo

#98 lore raw

PATCH 45/141 net: mscc: ocelot: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/mscc/ocelot_vcap.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/mscc/ocelot_vcap.c +1 -0
index d8c778ee6f1b..8f3ed81b9a08 100644
@@ -761,6 +761,7 @@ static void is1_entry_set(struct ocelot *ocelot, int ix,
 			vcap_key_bytes_set(vcap, &data, VCAP_IS1_HK_ETYPE,
 					   etype.value, etype.mask);
 		}
+		break;
 	}
 	default:
 		break;
Signature · 1 line
2.27.0
#99 lore raw

Re: [PATCH 045/141] net: mscc: ocelot: Fix fall-through warnings for Clang

Hi all,

It's been more than 3 months; who can take this, please? :)

Thanks
--
Gustavo

Quoted 25 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/mscc/ocelot_vcap.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/mscc/ocelot_vcap.c +1 -0
index d8c778ee6f1b..8f3ed81b9a08 100644
@@ -761,6 +761,7 @@ static void is1_entry_set(struct ocelot *ocelot, int ix,
 			vcap_key_bytes_set(vcap, &data, VCAP_IS1_HK_ETYPE,
 					   etype.value, etype.mask);
 		}
+		break;
 	}
 	default:
 		break;
Signature · 1 line
2.27.0
maintainer Reviewed-by
#100 lore raw

Re: [PATCH 045/141] net: mscc: ocelot: Fix fall-through warnings for Clang

Hi Gustavo,

Quoted 16 lines · Gustavo A. R. Silva

Hi all,

It's been more than 3 months; who can take this, please? :)

Thanks
--
Gustavo

Quoted 7 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---

You'd obviously need to resend. But when you do please add my:

And by the way, I think the netdev maintainers might want to take the patches on network drivers to avoid conflicts, but on the other hand they might not be too keen on cherry-picking bits and pieces of your 141 patch series. Would you mind creating a bundle of patches only for netdev? I see there's definitely more than just one patch, they would certainly get in a lot quicker that way.

#101 lore raw

Re: [PATCH 045/141] net: mscc: ocelot: Fix fall-through warnings for Clang

Hi Vladimir,

Quoted 22 lines · Vladimir Oltean

Hi Gustavo,

Quoted 16 lines · Gustavo A. R. Silva

Hi all,

It's been more than 3 months; who can take this, please? :)

Thanks
--
Gustavo

Quoted 7 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of just letting the code fall through to the next case.

---

You'd obviously need to resend. But when you do please add my:

Quoted 8 lines

And by the way, I think the netdev maintainers might want to take the patches on network drivers to avoid conflicts, but on the other hand they might not be too keen on cherry-picking bits and pieces of your 141 patch series. Would you mind creating a bundle of patches only for netdev? I see there's definitely more than just one patch, they would certainly get in a lot quicker that way.

Thanks for your feedback. I already sent those patches again. I hope they are applied this time. :)

--
Gustavo

#102 lore raw

PATCH 46/141 netxen_nic: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a goto statement instead of just letting the code fall through to the next case.

---
 drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c +1 -0
index 94546ed5f867..2cd089cca622 100644
@@ -1686,6 +1686,7 @@ netxen_process_rcv_ring(struct nx_host_sds_ring *sds_ring, int max)
 			break;
 		case NETXEN_NIC_RESPONSE_DESC:
 			netxen_handle_fw_message(desc_cnt, consumer, sds_ring);
+			goto skip;
 		default:
 			goto skip;
 		}
Signature · 1 line
2.27.0
#103 lore raw

PATCH 47/141 nfp: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/netronome/nfp/nfp_net_repr.c +1 -0
index b3cabc274121..3b8e675087de 100644
@@ -103,6 +103,7 @@ nfp_repr_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
 	case NFP_PORT_PF_PORT:
 	case NFP_PORT_VF_PORT:
 		nfp_repr_vnic_get_stats64(repr->port, stats);
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#104 lore raw

PATCH 48/141 perf/x86: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword as a replacement for a /* fall through */ comment, instead of letting the code fall through to the next case.

Notice that Clang doesn't recognize /* fall through */ comments as implicit fall-through markings.

---
 arch/x86/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/core.c +1 -1
index a88c94d65693..550c5e7002b9 100644
@@ -1174,7 +1174,7 @@ static inline void x86_assign_hw_event(struct perf_event *event,
 	case INTEL_PMC_IDX_METRIC_BASE ... INTEL_PMC_IDX_METRIC_END:
 		/* All the metric events are mapped onto the fixed counter 3. */
 		idx = INTEL_PMC_IDX_FIXED_SLOTS;
-		/* fall through */
+		fallthrough;
 	case INTEL_PMC_IDX_FIXED ... INTEL_PMC_IDX_FIXED_BTS-1:
 		hwc->config_base = MSR_ARCH_PERFMON_FIXED_CTR_CTRL;
 		hwc->event_base = MSR_ARCH_PERFMON_FIXED_CTR0 +
Signature · 1 line
2.27.0
#105 lore raw

PATCH 49/141 pinctrl: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/pinctrl/renesas/pinctrl-rza1.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pinctrl/renesas/pinctrl-rza1.c +1 -0
index 15dd007700c2..10020fe302b8 100644
@@ -931,6 +931,7 @@ static int rza1_parse_pinmux_node(struct rza1_pinctrl *rza1_pctl,
 		case PIN_CONFIG_OUTPUT:	/* for DT backwards compatibility */
 		case PIN_CONFIG_OUTPUT_ENABLE:
 			pinmux_flags |= MUX_FLAGS_SWIO_OUTPUT;
+			break;
 		default:
 			break;
 
Signature · 1 line
2.27.0
Reviewed-by on v1 49/141
#106 lore raw

Re: [PATCH 049/141] pinctrl: Fix fall-through warnings for Clang

Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

i.e. will queue in renesas-pinctrl-for-v5.11.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#107 lore raw

Re: [PATCH 049/141] pinctrl: Fix fall-through warnings for Clang

Quoted 11 lines · Geert Uytterhoeven
Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

i.e. will queue in renesas-pinctrl-for-v5.11.

Thanks, Geert.
--
Gustavo

#108 lore raw

PATCH 50/141 RDMA/mlx5: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding the new pseudo-keyword fallthrough; instead of letting the code fall through to the next case.

---
 drivers/infiniband/hw/mlx5/qp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/hw/mlx5/qp.c +1 -0
index 600e056798c0..ccaa4589331c 100644
@@ -2460,6 +2460,7 @@ static int check_qp_type(struct mlx5_ib_dev *dev, struct ib_qp_init_attr *attr,
 	case IB_QPT_GSI:
 		if (dev->profile == &raw_eth_profile)
 			goto out;
+		fallthrough;
 	case IB_QPT_RAW_PACKET:
 	case IB_QPT_UD:
 	case MLX5_IB_QPT_REG_UMR:
Signature · 1 line
2.27.0
Acked-by on v1 50/141
#109 lore raw

Re: [PATCH 050/141] RDMA/mlx5: Fix fall-through warnings for Clang

Quoted 10 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding the new pseudo-keyword fallthrough; instead of letting the code fall through to the next case.

---
 drivers/infiniband/hw/mlx5/qp.c | 1 +
 1 file changed, 1 insertion(+)

Thanks,

#110 lore raw

Re: [PATCH 050/141] RDMA/mlx5: Fix fall-through warnings for Clang

Quoted 12 lines · Leon Romanovsky
Quoted 10 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding the new pseudo-keyword fallthrough; instead of letting the code fall through to the next case.

---
 drivers/infiniband/hw/mlx5/qp.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 2 lines

Thanks,

Thanks, Leon.
--
Gustavo

#111 lore raw

PATCH 51/141 reiserfs: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 fs/reiserfs/namei.c | 1 +
 1 file changed, 1 insertion(+)
fs/reiserfs/namei.c +1 -0
index 1594687582f0..90bb49bfdba0 100644
@@ -132,6 +132,7 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
 			return IO_ERROR;
 		}
 		PATH_LAST_POSITION(path)--;
+		break;
 
 	case ITEM_FOUND:
 		break;
Signature · 1 line
2.27.0
#112 lore raw

Re: [PATCH 051/141] reiserfs: Fix fall-through warnings for Clang

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 23 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 fs/reiserfs/namei.c | 1 +
 1 file changed, 1 insertion(+)
fs/reiserfs/namei.c +1 -0
index 1594687582f0..90bb49bfdba0 100644
@@ -132,6 +132,7 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
 			return IO_ERROR;
 		}
 		PATH_LAST_POSITION(path)--;
+		break;
 
 	case ITEM_FOUND:
 		break;
#113 lore raw

Re: [PATCH 051/141] reiserfs: Fix fall-through warnings for Clang

Hi,

I'm taking this in my -next[1] branch for v5.14.

Thanks
--
Gustavo

[1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp

Quoted 32 lines · Gustavo A. R. Silva

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 23 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 fs/reiserfs/namei.c | 1 +
 1 file changed, 1 insertion(+)
fs/reiserfs/namei.c +1 -0
index 1594687582f0..90bb49bfdba0 100644
@@ -132,6 +132,7 @@ int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
 			return IO_ERROR;
 		}
 		PATH_LAST_POSITION(path)--;
+		break;
 
 	case ITEM_FOUND:
 		break;
#114 lore raw

PATCH 52/141 security: keys: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 security/keys/process_keys.c | 1 +
 1 file changed, 1 insertion(+)
security/keys/process_keys.c +1 -0
index 1fe8b934f656..e3d79a7b6db6 100644
@@ -783,6 +783,7 @@ key_ref_t lookup_user_key(key_serial_t id, unsigned long lflags,
 				if (need_perm != KEY_AUTHTOKEN_OVERRIDE &&
 				    need_perm != KEY_DEFER_PERM_CHECK)
 					goto invalid_key;
+				break;
 			case 0:
 				break;
 			}
Signature · 1 line
2.27.0
maintainer Reviewed-by on v1 52/141
#115 lore raw

Re: [PATCH 052/141] security: keys: Fix fall-through warnings for Clang

Quoted 26 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 security/keys/process_keys.c | 1 +
 1 file changed, 1 insertion(+)
security/keys/process_keys.c +1 -0
index 1fe8b934f656..e3d79a7b6db6 100644
@@ -783,6 +783,7 @@ key_ref_t lookup_user_key(key_serial_t id, unsigned long lflags,
 				if (need_perm != KEY_AUTHTOKEN_OVERRIDE &&
 				    need_perm != KEY_DEFER_PERM_CHECK)
 					goto invalid_key;
+				break;
 			case 0:
 				break;
 			}
Signature · 1 line
2.27.0

/Jarkko

#116 lore raw

Re: [PATCH 052/141] security: keys: Fix fall-through warnings for Clang

Quoted 22 lines · Jarkko Sakkinen
Quoted 21 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 security/keys/process_keys.c | 1 +
 1 file changed, 1 insertion(+)
security/keys/process_keys.c +1 -0
index 1fe8b934f656..e3d79a7b6db6 100644
@@ -783,6 +783,7 @@ key_ref_t lookup_user_key(key_serial_t id, unsigned long lflags,
 				if (need_perm != KEY_AUTHTOKEN_OVERRIDE &&
 				    need_perm != KEY_DEFER_PERM_CHECK)
 					goto invalid_key;
+				break;
 			case 0:
 				break;
Quoted 8 lines
Quoted 5 lines
security/keys/process_keys.c +0 -0
 			}
Signature · 1 line
2.27.0

Thank you, Jarkko.
--
Gustavo

#117 lore raw

PATCH 53/141 selinux: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 security/selinux/hooks.c | 1 +
 1 file changed, 1 insertion(+)
security/selinux/hooks.c +1 -0
index 6b1826fc3658..e57774367b3a 100644
@@ -4029,6 +4029,7 @@ static int selinux_kernel_load_data(enum kernel_load_data_id id, bool contents)
 	switch (id) {
 	case LOADING_MODULE:
 		rc = selinux_kernel_module_from_file(NULL);
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
maintainer Applied
#118 lore raw

Re: [PATCH 053/141] selinux: Fix fall-through warnings for Clang

Quoted 10 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 security/selinux/hooks.c | 1 +
 1 file changed, 1 insertion(+)

Merged into selinux/next, thanks.

Quoted 14 lines
security/selinux/hooks.c +1 -1
index 6b1826fc3658..e57774367b3a 100644
@@ -4029,6 +4029,7 @@ static int selinux_kernel_load_data(enum kernel_load_data_id id, bool contents)
        switch (id) {
        case LOADING_MODULE:
                rc = selinux_kernel_module_from_file(NULL);
+               break;
        default:
                break;
        }
--

2.27.0

Signature · 2 lines
paul moore
www.paul-moore.com
#119 lore raw

Re: [PATCH 053/141] selinux: Fix fall-through warnings for Clang

Quoted 7 lines · Paul Moore
Quoted 5 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Quoted 7 lines
Quoted 5 lines
---
 security/selinux/hooks.c | 1 +
 1 file changed, 1 insertion(+)

Merged into selinux/next, thanks.

Thanks, Paul.
--
Gustavo

#120 lore raw

PATCH 54/141 target: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a break statement and a fallthrough pseudo-keyword instead of letting the code fall through to the next case.

---
 drivers/target/target_core_iblock.c | 1 +
 drivers/target/target_core_pr.c     | 1 +
 2 files changed, 2 insertions(+)
drivers/target/target_core_iblock.c +1 -0
index f2bd2e207e0b..8ed93fd205c7 100644
@@ -211,6 +211,7 @@ static unsigned long long iblock_emulate_read_cap_with_block_size(
 			break;
 		case 512:
 			blocks_long <<= 3;
+			break;
 		default:
 			break;
 		}
drivers/target/target_core_pr.c +1 -0
index 5f79ea05f9b8..14db5e568f22 100644
@@ -337,6 +337,7 @@ static int core_scsi3_pr_seq_non_holder(struct se_cmd *cmd, u32 pr_reg_type,
 	switch (pr_reg_type) {
 	case PR_TYPE_WRITE_EXCLUSIVE:
 		we = 1;
+		fallthrough;
 	case PR_TYPE_EXCLUSIVE_ACCESS:
 		/*
 		 * Some commands are only allowed for the persistent reservation
Signature · 1 line
2.27.0
#121 lore raw

PATCH 55/141 uprobes/x86: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 arch/x86/kernel/uprobes.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/uprobes.c +2 -0
index 3fdaa042823d..90f44f44c209 100644
@@ -1015,6 +1015,8 @@ int arch_uprobe_exception_notify(struct notifier_block *self, unsigned long val,
 		if (uprobe_post_sstep_notifier(regs))
 			ret = NOTIFY_STOP;
 
+		break;
+
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#122 lore raw

PATCH 56/141 vxge: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a return statement instead of letting the code fall through to the next case.

---
 drivers/net/ethernet/neterion/vxge/vxge-config.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/neterion/vxge/vxge-config.c +1 -0
index f5d48d7c4ce2..34c10ee086eb 100644
@@ -3784,6 +3784,7 @@ vxge_hw_rts_rth_data0_data1_get(u32 j, u64 *data0, u64 *data1,
 			VXGE_HW_RTS_ACCESS_STEER_DATA1_RTH_ITEM1_ENTRY_EN |
 			VXGE_HW_RTS_ACCESS_STEER_DATA1_RTH_ITEM1_BUCKET_DATA(
 			itable[j]);
+		return;
 	default:
 		return;
 	}
Signature · 1 line
2.27.0
#123 lore raw

PATCH 57/141 watchdog: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword instead of letting the code fall through to the next case.

---
 drivers/watchdog/machzwd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/machzwd.c +1 -0
index 743377c5b173..73f2221f6222 100644
@@ -174,6 +174,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)
 		fallthrough;
 	case WD2:
 		zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
+		fallthrough;
 	default:
 		return;
 	}
Signature · 1 line
2.27.0
maintainer Acked-by on v1 57/141
#124 lore raw

Re: [PATCH 057/141] watchdog: Fix fall-through warnings for Clang

Quoted 15 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword instead of letting the code fall through to the next case.

---
 drivers/watchdog/machzwd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/machzwd.c +0 -0
index 743377c5b173..73f2221f6222 100644

drivers/watchdog/machzwd.c static inline void zf_set_timer(unsigned short new, unsigned char n) · line 177

Quoted 4 lines
drivers/watchdog/machzwd.c +1 -0
@@ -174,6 +174,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)
 		fallthrough;
 	case WD2:
 		zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
+		fallthrough;

fallthrough to return ? Oh well, this is an old style driver anyway, so I guess who cares.

Guenter

Quoted 6 lines
drivers/watchdog/machzwd.c +0 -0
 	default:
 		return;
 	}
Signature · 1 line
2.27.0
#125 lore raw

Re: [PATCH 057/141] watchdog: Fix fall-through warnings for Clang

Quoted 11 lines · Guenter Roeck
Quoted 10 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword instead of letting the code fall through to the next case.

---
 drivers/watchdog/machzwd.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 12 lines

drivers/watchdog/machzwd.c static inline void zf_set_timer(unsigned short new, unsigned char n) · line 177

Quoted 9 lines
drivers/watchdog/machzwd.c +1 -0
index 743377c5b173..73f2221f6222 100644
@@ -174,6 +174,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)
 		fallthrough;
 	case WD2:
 		zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
+		fallthrough;

fallthrough to return ? Oh well, this is an old style driver anyway, so I guess who cares.

:)

Quoted 1 line

Thanks, Guenter.
--
Gustavo

#126 lore raw

Re: [PATCH 057/141] watchdog: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

Hi all,

It's been more than 3 months; who can take this, please? :)

Thanks
--
Gustavo

Quoted 25 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword instead of letting the code fall through to the next case.

---
 drivers/watchdog/machzwd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/machzwd.c +1 -0
index 743377c5b173..73f2221f6222 100644
@@ -174,6 +174,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)
 		fallthrough;
 	case WD2:
 		zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
+		fallthrough;
 	default:
 		return;
 	}
Signature · 1 line
2.27.0
maintainer
#127 lore raw

Re: [PATCH 057/141] watchdog: Fix fall-through warnings for Clang

Quoted 4 lines · Gustavo A. R. Silva

Hi all,

It's been more than 3 months; who can take this, please? :)

I am not in favor of cosmetic patches for old drivers, and I am not going to provide tags for them anymore. The driver should be converted to use the watchdog core, or it should be dropped.

Guenter

#128 lore raw

Re: [PATCH 057/141] watchdog: Fix fall-through warnings for Clang

Quoted 7 lines · Guenter Roeck
Quoted 4 lines · Gustavo A. R. Silva

Hi all,

It's been more than 3 months; who can take this, please? :)

I am not in favor of cosmetic patches for old drivers,

Me either. However, this is not a cosmetic patch[1].

Quoted 3 lines

and I am not going to provide tags for them anymore. The driver should be converted to use the watchdog core, or it should be dropped.

Is it OK with you if I carry this in my tree for a future pull-request to Linus?

Thanks!
--
Gustavo

[1] https://github.com/KSPP/linux/issues/115

#129 lore raw

Re: [PATCH 057/141] watchdog: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

Hi all,

I'm taking this in my -next[1] branch for v5.14.

Thanks
--
Gustavo

[1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp

Quoted 23 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword instead of letting the code fall through to the next case.

---
 drivers/watchdog/machzwd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/machzwd.c +1 -0
index 743377c5b173..73f2221f6222 100644
@@ -174,6 +174,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)
 		fallthrough;
 	case WD2:
 		zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
+		fallthrough;
 	default:
 		return;
 	}
#130 lore raw

PATCH 58/141 xen-blkfront: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/block/xen-blkfront.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/xen-blkfront.c +1 -0
index 48629d3433b4..34b028be78ab 100644
@@ -2462,6 +2462,7 @@ static void blkback_changed(struct xenbus_device *dev,
 			break;
 		if (talk_to_blkback(dev, info))
 			break;
+		break;
 	case XenbusStateInitialising:
 	case XenbusStateInitialised:
 	case XenbusStateReconfiguring:
Signature · 1 line
2.27.0
#131 lore raw

Re: [PATCH 058/141] xen-blkfront: Fix fall-through warnings for Clang

Quoted 15 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/block/xen-blkfront.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/xen-blkfront.c +0 -0
index 48629d3433b4..34b028be78ab 100644

drivers/block/xen-blkfront.c static void blkback_changed(struct xenbus_device *dev, · line 2468

Quoted 7 lines
drivers/block/xen-blkfront.c +1 -0
@@ -2462,6 +2462,7 @@ static void blkback_changed(struct xenbus_device *dev,
 			break;
 		if (talk_to_blkback(dev, info))
 			break;
+		break;
 	case XenbusStateInitialising:
 	case XenbusStateInitialised:
 	case XenbusStateReconfiguring:

Reviewed-by Boris Ostrovsky <[email protected]>

(for patch 138 as well)

Although I thought using 'fallthrough' attribute was the more common approach.

-boris

#132 lore raw

Re: [PATCH 058/141] xen-blkfront: Fix fall-through warnings for Clang

Quoted 29 lines · On Fri, Nov 20, 2020 at 04:36:26PM -0500, [email protected] wrote:
Quoted 15 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/block/xen-blkfront.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/xen-blkfront.c +0 -0
index 48629d3433b4..34b028be78ab 100644

drivers/block/xen-blkfront.c static void blkback_changed(struct xenbus_device *dev, · line 2468

Quoted 7 lines
drivers/block/xen-blkfront.c +1 -0
@@ -2462,6 +2462,7 @@ static void blkback_changed(struct xenbus_device *dev,
 			break;
 		if (talk_to_blkback(dev, info))
 			break;
+		break;
 	case XenbusStateInitialising:
 	case XenbusStateInitialised:
 	case XenbusStateReconfiguring:

Reviewed-by Boris Ostrovsky <[email protected]>

Quoted 1 line

(for patch 138 as well)

Thank you for both reviews, Boris.

Quoted 1 line

Although I thought using 'fallthrough' attribute was the more common approach.

I've got it. I will consider that for a future patch.

Thanks
--
Gustavo

#133 lore raw

Re: [PATCH 058/141] xen-blkfront: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva
Quoted 15 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/block/xen-blkfront.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/xen-blkfront.c +0 -0
index 48629d3433b4..34b028be78ab 100644

drivers/block/xen-blkfront.c static void blkback_changed(struct xenbus_device *dev, · line 2465

Quoted 4 lines
drivers/block/xen-blkfront.c +1 -0
@@ -2462,6 +2462,7 @@ static void blkback_changed(struct xenbus_device *dev,
 			break;
 		if (talk_to_blkback(dev, info))
 			break;
+		break;

I would have added a fallthrough like it's done below in XenbusStateClosed.

Also, FWIW, I think clang's fallthrough warnings are a bit too verbose. Falling through to a break like the case here shouldn't cause a warning IMO, falling through to anything != break should indeed cause those warnings to appear.

Thanks, Roger.

maintainer
#134 lore raw

Re: [PATCH 058/141] xen-blkfront: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva
Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Applied to: xen/tip.git for-linus-5.11

Juergen

#135 lore raw

PATCH 59/141 regulator: as3722: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword instead of letting the code fall through to the next case.

---
 drivers/regulator/as3722-regulator.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/regulator/as3722-regulator.c +2 -1
index 33ca197860b3..7bebf9ce6271 100644
@@ -455,7 +455,8 @@ static int as3722_sd_set_mode(struct regulator_dev *rdev,
 	switch (mode) {
 	case REGULATOR_MODE_FAST:
 		val = as3722_reg_lookup[id].mode_mask;
-	case REGULATOR_MODE_NORMAL: /* fall down */
+		fallthrough;
+	case REGULATOR_MODE_NORMAL:
 		break;
 	default:
 		return -EINVAL;
Signature · 1 line
2.27.0
#136 lore raw

PATCH 60/141 habanalabs: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword instead of letting the code fall through to the next case.

---
 drivers/misc/habanalabs/gaudi/gaudi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/misc/habanalabs/gaudi/gaudi.c +1 -0
index 2519a34e25b7..eab4c0dc65c5 100644
@@ -5436,6 +5436,7 @@ static void gaudi_handle_ecc_event(struct hl_device *hdev, u16 event_type,
 		params.num_memories = 33;
 		params.derr = true;
 		params.disable_clock_gating = true;
+		fallthrough;
 	default:
 		return;
 	}
Signature · 1 line
2.27.0
#137 lore raw

Re: [PATCH 060/141] habanalabs: Fix fall-through warnings for Clang

Quoted 24 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword instead of letting the code fall through to the next case.

---
 drivers/misc/habanalabs/gaudi/gaudi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/misc/habanalabs/gaudi/gaudi.c +1 -1
index 2519a34e25b7..eab4c0dc65c5 100644
@@ -5436,6 +5436,7 @@ static void gaudi_handle_ecc_event(struct hl_device *hdev, u16 event_type,
                params.num_memories = 33;
                params.derr = true;
                params.disable_clock_gating = true;
+               fallthrough;
        default:
                return;
        }
--
Quoted 2 lines

2.27.0

Hi Gustavo,
So this is actually an error in the code, there shouldn't be a fallthrough there.
So NAK for this patch, I'll have to send a fix for that. Thanks for catching this :)

Oded

#138 lore raw

Re: [PATCH 060/141] habanalabs: Fix fall-through warnings for Clang

Quoted 25 lines · Oded Gabbay
Quoted 23 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword instead of letting the code fall through to the next case.

---
 drivers/misc/habanalabs/gaudi/gaudi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/misc/habanalabs/gaudi/gaudi.c +1 -0
index 2519a34e25b7..eab4c0dc65c5 100644
@@ -5436,6 +5436,7 @@ static void gaudi_handle_ecc_event(struct hl_device *hdev, u16 event_type,
                params.num_memories = 33;
                params.derr = true;
                params.disable_clock_gating = true;
+               fallthrough;
        default:
                return;
        }
Quoted 8 lines
Quoted 3 lines

--
2.27.0

Hi Gustavo,
So this is actually an error in the code, there shouldn't be a fallthrough there.
So NAK for this patch, I'll have to send a fix for that. Thanks for catching this :)

Awesome. Glad this helped to catch a bug. :)

Thanks
--
Gustavo

#139 lore raw

PATCH 61/141 tee: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/tee/tee_core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/tee/tee_core.c +1 -0
index 6ade4a5c4840..5fdf26688230 100644
@@ -452,6 +452,7 @@ static int params_to_user(struct tee_ioctl_param __user *uparams,
 		case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
 			if (put_user((u64)p->u.memref.size, &up->b))
 				return -EFAULT;
+			break;
 		default:
 			break;
 		}
Signature · 1 line
2.27.0
Acked-by on v1 61/141
#140 lore raw

Re: [PATCH 061/141] tee: Fix fall-through warnings for Clang

Quoted 10 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/tee/tee_core.c | 1 +
 1 file changed, 1 insertion(+)

Thanks,
Jens

#141 lore raw

Re: [PATCH 061/141] tee: Fix fall-through warnings for Clang

Quoted 7 lines · Jens Wiklander
Quoted 5 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Quoted 7 lines
Quoted 5 lines
---
 drivers/tee/tee_core.c | 1 +
 1 file changed, 1 insertion(+)

Thanks, Jens.
--
Gustavo

#142 lore raw

Re: [PATCH 061/141] tee: Fix fall-through warnings for Clang

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 20 lines · Gustavo A. R. Silva
Quoted 7 lines · Jens Wiklander
Quoted 5 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Quoted 7 lines
Quoted 5 lines
---
 drivers/tee/tee_core.c | 1 +
 1 file changed, 1 insertion(+)

Thanks, Jens.
--
Gustavo

#143 lore raw

Re: [PATCH 061/141] tee: Fix fall-through warnings for Clang

Hi,

Quoted 24 lines · Gustavo A. R. Silva

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 15 lines · Gustavo A. R. Silva
Quoted 14 lines · Jens Wiklander
Quoted 10 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/tee/tee_core.c | 1 +
 1 file changed, 1 insertion(+)

I've added this to my -next[1] branch for v5.14.

Thanks
--
Gustavo

[1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp

#144 lore raw

PATCH 62/141 HID: usbhid: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a couple of break statements instead of letting the code fall through to the next case.

---
 drivers/hid/usbhid/hid-core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/hid/usbhid/hid-core.c +2 -0
index 17a29ee0ac6c..86257ce6d619 100644
@@ -438,6 +438,7 @@ static void hid_irq_out(struct urb *urb)
 		break;
 	case -ESHUTDOWN:	/* unplug */
 		unplug = 1;
+		break;
 	case -EILSEQ:		/* protocol error or unplug */
 	case -EPROTO:		/* protocol error or unplug */
 	case -ECONNRESET:	/* unlink */
@@ -489,6 +490,7 @@ static void hid_ctrl(struct urb *urb)
 		break;
 	case -ESHUTDOWN:	/* unplug */
 		unplug = 1;
+		break;
 	case -EILSEQ:		/* protocol error or unplug */
 	case -EPROTO:		/* protocol error or unplug */
 	case -ECONNRESET:	/* unlink */
Signature · 1 line
2.27.0
maintainer Applied
#145 lore raw

Re: [PATCH 062/141] HID: usbhid: Fix fall-through warnings for Clang

Quoted 23 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a couple of break statements instead of letting the code fall through to the next case.

---
 drivers/hid/usbhid/hid-core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/hid/usbhid/hid-core.c +1 -0
index 17a29ee0ac6c..86257ce6d619 100644
@@ -438,6 +438,7 @@ static void hid_irq_out(struct urb *urb)
 		break;
 	case -ESHUTDOWN:	/* unplug */
 		unplug = 1;
+		break;
 	case -EILSEQ:		/* protocol error or unplug */
 	case -EPROTO:		/* protocol error or unplug */
 	case -ECONNRESET:	/* unlink */

drivers/hid/usbhid/hid-core.c static void hid_ctrl(struct urb *urb) · line 496

Quoted 7 lines
drivers/hid/usbhid/hid-core.c +1 -0
@@ -489,6 +490,7 @@ static void hid_ctrl(struct urb *urb)
 		break;
 	case -ESHUTDOWN:	/* unplug */
 		unplug = 1;
+		break;
 	case -EILSEQ:		/* protocol error or unplug */
 	case -EPROTO:		/* protocol error or unplug */
 	case -ECONNRESET:	/* unlink */

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs
#146 lore raw

PATCH 63/141 HID: input: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a goto statement instead of letting the code fall through to the next case.

---
 drivers/hid/hid-input.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hid/hid-input.c +1 -0
index 9770db624bfa..37601b800a2e 100644
@@ -743,6 +743,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 				field->flags |= HID_MAIN_ITEM_RELATIVE;
 				break;
 			}
+			goto unknown;
 
 		default: goto unknown;
 		}
Signature · 1 line
2.27.0
maintainer
#147 lore raw

Re: [PATCH 063/141] HID: input: Fix fall-through warnings for Clang

Quoted 15 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a goto statement instead of letting the code fall through to the next case.

---
 drivers/hid/hid-input.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hid/hid-input.c +0 -0
index 9770db624bfa..37601b800a2e 100644

drivers/hid/hid-input.c static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel · line 748

Quoted 6 lines
drivers/hid/hid-input.c +1 -0
@@ -743,6 +743,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 				field->flags |= HID_MAIN_ITEM_RELATIVE;
 				break;
 			}
+			goto unknown;
 
 		default: goto unknown;

This makes my eyes hurt :) But adding the annotation would be ugly as well, so let me just take it as-is.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#148 lore raw

RE: [PATCH 063/141] HID: input: Fix fall-through warnings for Clang

From: Jiri Kosina <[email protected]>

Quoted 23 lines

Sent: 25 November 2020 13:04

Quoted 20 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a goto statement instead of letting the code fall through to the next case.

---
 drivers/hid/hid-input.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hid/hid-input.c +1 -0
index 9770db624bfa..37601b800a2e 100644
@@ -743,6 +743,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 				field->flags |= HID_MAIN_ITEM_RELATIVE;
 				break;
 			}
+			goto unknown;
 
Quoted 4 lines

drivers/hid/hid-input.c static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel · line 748

Quoted 1 line
drivers/hid/hid-input.c +0 -0
 		default: goto unknown;

This makes my eyes hurt :) But adding the annotation would be ugly as well, so let me just take it as-is.

                case HID_GD_RFKILL_BTN:
                        /* MS wireless radio ctl extension, also check CA */
                        if (field->application == HID_GD_WIRELESS_RADIO_CTLS) {
                                map_key_clear(KEY_RFKILL);
                                /* We need to simulate the btn release */
                                field->flags |= HID_MAIN_ITEM_RELATIVE;
                                break;
                        }

It might be best to invert the condition and de-indent the code.

                case HID_GD_RFKILL_BTN:
                        /* MS wireless radio ctl extension, also check CA */
                        if (field->application != HID_GD_WIRELESS_RADIO_CTLS)
                                goto unknown;
                        map_key_clear(KEY_RFKILL);
                        /* We need to simulate the btn release */
                        field->flags |= HID_MAIN_ITEM_RELATIVE;
                        break;

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)

#149 lore raw

PATCH 64/141 ACPI: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/acpi/sbshc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/sbshc.c +1 -0
index 53c2862c4c75..0b3de0e63633 100644
@@ -231,6 +231,7 @@ static int smbus_alarm(void *context)
 		case ACPI_SBS_BATTERY:
 			acpi_os_execute(OSL_NOTIFY_HANDLER,
 					acpi_smbus_callback, hc);
+			break;
 		default:;
 	}
 	mutex_unlock(&hc->lock);
Signature · 1 line
2.27.0
#150 lore raw

Re: [PATCH 064/141] ACPI: Fix fall-through warnings for Clang

Quoted 16 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/acpi/sbshc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/sbshc.c +0 -0
index 53c2862c4c75..0b3de0e63633 100644

drivers/acpi/sbshc.c static int smbus_alarm(void *context) · line 235

Quoted 5 lines
drivers/acpi/sbshc.c +1 -0
@@ -231,6 +231,7 @@ static int smbus_alarm(void *context)
                case ACPI_SBS_BATTERY:
                        acpi_os_execute(OSL_NOTIFY_HANDLER,
                                        acpi_smbus_callback, hc);
+                       break;
                default:;

Why don't you simply drop the default case below (it's empty anyway)?

Quoted 5 lines
drivers/acpi/sbshc.c +0 -1
        }
        mutex_unlock(&hc->lock);
--

2.27.0

#151 lore raw

PATCH 65/141 airo: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/net/wireless/cisco/airo.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/cisco/airo.c +1 -0
index 87b9398b03fd..41a41e18b956 100644
@@ -7067,6 +7067,7 @@ static int airo_set_power(struct net_device *dev,
 			local->config.rmode &= ~RXMODE_MASK;
 			local->config.rmode |= RXMODE_BC_MC_ADDR;
 			set_bit (FLAG_COMMIT, &local->flags);
+			break;
 		case IW_POWER_ON:
 			/* This is broken, fixme ;-) */
 			break;
Signature · 1 line
2.27.0
#152 lore raw

Re: [PATCH 065/141] airo: Fix fall-through warnings for Clang

Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

4 patches applied to wireless-drivers-next.git, thanks.

48264b23fade airo: Fix fall-through warnings for Clang f48d7dccb3e4 rt2x00: Fix fall-through warnings for Clang 0662fbebf4fb rtw88: Fix fall-through warnings for Clang 18572b0b5493 zd1201: Fix fall-through warnings for Clang

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/b3c0f74f5b6e6bff9f1609b310319b6fdd9ee205.1605896059.git.gustavoars@kernel.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#153 lore raw

PATCH 66/141 ALSA: hdspm: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 sound/pci/rme9652/hdspm.c | 1 +
 1 file changed, 1 insertion(+)
sound/pci/rme9652/hdspm.c +1 -0
index 4a1f576dd9cf..f25a448dd636 100644
@@ -6321,6 +6321,7 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,
 				(statusregister & HDSPM_RX_64ch) ? 1 : 0;
 			/* TODO: Mac driver sets it when f_s>48kHz */
 			status.card_specific.madi.frame_format = 0;
+			break;
 
 		default:
 			break;
Signature · 1 line
2.27.0
#155 lore raw

Re: [PATCH 066/141] ALSA: hdspm: Fix fall-through warnings for Clang

Quoted 11 lines · Takashi Iwai
Quoted 7 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Thanks, applied.

Thanks for all you've taken, Takashi.
--
Gustavo

#156 lore raw

PATCH 67/141 ALSA: pcsp: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 sound/drivers/pcsp/pcsp_input.c | 1 +
 1 file changed, 1 insertion(+)
sound/drivers/pcsp/pcsp_input.c +1 -0
index 52b475b310c3..e79603fe743d 100644
@@ -54,6 +54,7 @@ static int pcspkr_input_event(struct input_dev *dev, unsigned int type,
 		case SND_BELL:
 			if (value)
 				value = 1000;
+			break;
 		case SND_TONE:
 			break;
 		default:
Signature · 1 line
2.27.0
#158 lore raw

PATCH 68/141 ALSA: sb: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 sound/isa/sb/sb8_main.c | 1 +
 1 file changed, 1 insertion(+)
sound/isa/sb/sb8_main.c +1 -0
index 86d0d2fdf48a..8d01692c4f2a 100644
@@ -506,6 +506,7 @@ static int snd_sb8_open(struct snd_pcm_substream *substream)
 		} else {
 			runtime->hw.rate_max = 15000;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#160 lore raw

PATCH 69/141 ath5k: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/net/wireless/ath/ath5k/mac80211-ops.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath5k/mac80211-ops.c +1 -0
index 5e866a193ed0..8f2719ff463c 100644
@@ -433,6 +433,7 @@ ath5k_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
 	case NL80211_IFTYPE_STATION:
 		if (ah->assoc)
 			rfilt |= AR5K_RX_FILTER_BEACON;
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#161 lore raw

Re: [PATCH 069/141] ath5k: Fix fall-through warnings for Clang

Quoted 7 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

3 patches applied to ath-next branch of ath.git, thanks.

e64fa6d92ac4 ath5k: Fix fall-through warnings for Clang e2cb11165445 carl9170: Fix fall-through warnings for Clang b6041e1a3020 wcn36xx: Fix fall-through warnings for Clang

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/e127232621c4de340509047a11d98093958303c5.1605896059.git.gustavoars@kernel.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#162 lore raw

PATCH 70/141 atm: fore200e: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword.

---
 drivers/atm/fore200e.c | 1 +
 1 file changed, 1 insertion(+)
drivers/atm/fore200e.c +1 -0
index 9a70bee84125..ba3ed1b77bc5 100644
@@ -423,6 +423,7 @@ fore200e_shutdown(struct fore200e* fore200e)
 	/* XXX shouldn't we *start* by deregistering the device? */
 	atm_dev_deregister(fore200e->atm_dev);
 
+	fallthrough;
     case FORE200E_STATE_BLANK:
 	/* nothing to do for that state */
 	break;
Signature · 1 line
2.27.0
#163 lore raw

Re: [PATCH 070/141] atm: fore200e: Fix fall-through warnings for Clang

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 22 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword.

---
 drivers/atm/fore200e.c | 1 +
 1 file changed, 1 insertion(+)
drivers/atm/fore200e.c +1 -0
index 9a70bee84125..ba3ed1b77bc5 100644
@@ -423,6 +423,7 @@ fore200e_shutdown(struct fore200e* fore200e)
 	/* XXX shouldn't we *start* by deregistering the device? */
 	atm_dev_deregister(fore200e->atm_dev);
 
+	fallthrough;
     case FORE200E_STATE_BLANK:
 	/* nothing to do for that state */
 	break;
#164 lore raw

Re: [PATCH 070/141] atm: fore200e: Fix fall-through warnings for Clang

Hi all,

I've added this to my -next[1] branch for v5.14.

Thanks
--
Gustavo

[1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp

Quoted 31 lines · Gustavo A. R. Silva

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 22 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword.

---
 drivers/atm/fore200e.c | 1 +
 1 file changed, 1 insertion(+)
drivers/atm/fore200e.c +1 -0
index 9a70bee84125..ba3ed1b77bc5 100644
@@ -423,6 +423,7 @@ fore200e_shutdown(struct fore200e* fore200e)
 	/* XXX shouldn't we *start* by deregistering the device? */
 	atm_dev_deregister(fore200e->atm_dev);
 
+	fallthrough;
     case FORE200E_STATE_BLANK:
 	/* nothing to do for that state */
 	break;
#165 lore raw

PATCH 71/141 braille_console: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/accessibility/braille/braille_console.c | 1 +
 1 file changed, 1 insertion(+)
drivers/accessibility/braille/braille_console.c +1 -0
index 9861302cc7db..359bead4b280 100644
@@ -246,6 +246,7 @@ static int keyboard_notifier_call(struct notifier_block *blk,
 				beep(440);
 		}
 	}
+		break;
 	case KBD_UNBOUND_KEYCODE:
 	case KBD_UNICODE:
 	case KBD_KEYSYM:
Signature · 1 line
2.27.0
#166 lore raw

Re: [PATCH 071/141] braille_console: Fix fall-through warnings for Clang

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 23 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/accessibility/braille/braille_console.c | 1 +
 1 file changed, 1 insertion(+)
drivers/accessibility/braille/braille_console.c +1 -0
index 9861302cc7db..359bead4b280 100644
@@ -246,6 +246,7 @@ static int keyboard_notifier_call(struct notifier_block *blk,
 				beep(440);
 		}
 	}
+		break;
 	case KBD_UNBOUND_KEYCODE:
 	case KBD_UNICODE:
 	case KBD_KEYSYM:
#167 lore raw

Re: [PATCH 071/141] braille_console: Fix fall-through warnings for Clang

Hi,

I'm taking this in my -next[1] branch for v5.14.

Thanks
--
Gustavo

[1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp

Quoted 32 lines · Gustavo A. R. Silva

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 23 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/accessibility/braille/braille_console.c | 1 +
 1 file changed, 1 insertion(+)
drivers/accessibility/braille/braille_console.c +1 -0
index 9861302cc7db..359bead4b280 100644
@@ -246,6 +246,7 @@ static int keyboard_notifier_call(struct notifier_block *blk,
 				beep(440);
 		}
 	}
+		break;
 	case KBD_UNBOUND_KEYCODE:
 	case KBD_UNICODE:
 	case KBD_KEYSYM:
#168 lore raw

PATCH 72/141 can: peak_usb: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/net/can/usb/peak_usb/pcan_usb_core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/can/usb/peak_usb/pcan_usb_core.c +2 -0
index c2764799f9ef..fd65a155be3b 100644
@@ -299,6 +299,8 @@ static void peak_usb_write_bulk_callback(struct urb *urb)
 		if (net_ratelimit())
 			netdev_err(netdev, "Tx urb aborted (%d)\n",
 				   urb->status);
+		break;
+
 	case -EPROTO:
 	case -ENOENT:
 	case -ECONNRESET:
Signature · 1 line
2.27.0
#169 lore raw

Re: [PATCH 072/141] can: peak_usb: Fix fall-through warnings for Clang

Quoted 16 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/net/can/usb/peak_usb/pcan_usb_core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/can/usb/peak_usb/pcan_usb_core.c +0 -0
index c2764799f9ef..fd65a155be3b 100644

drivers/net/can/usb/peak_usb/pcan_usb_core.c static void peak_usb_write_bulk_callback(struct urb *urb) · line 306

Quoted 8 lines
drivers/net/can/usb/peak_usb/pcan_usb_core.c +2 -0
@@ -299,6 +299,8 @@ static void peak_usb_write_bulk_callback(struct urb *urb)
 		if (net_ratelimit())
 			netdev_err(netdev, "Tx urb aborted (%d)\n",
 				   urb->status);
+		break;
+
 	case -EPROTO:
 	case -ENOENT:
 	case -ECONNRESET:

What about moving the default to the end if the case, which is more common anyways:

drivers/net/can/usb/peak_usb/pcan_usb_core.c +5 -5
index 204ccb27d6d9..e8977dd10902 100644
@@ -295,16 +295,16 @@ static void peak_usb_write_bulk_callback(struct urb *urb)
                netif_trans_update(netdev);
                break;
 
-       default:
-               if (net_ratelimit())
-                       netdev_err(netdev, "Tx urb aborted (%d)\n",
-                                  urb->status);
        case -EPROTO:
        case -ENOENT:
        case -ECONNRESET:
        case -ESHUTDOWN:
-
                break;
+
+       default:
+               if (net_ratelimit())
+                       netdev_err(netdev, "Tx urb aborted (%d)\n",
+                                  urb->status);
        }
 
        /* should always release echo skb and corresponding context */

Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
#170 lore raw

Re: [PATCH 072/141] can: peak_usb: Fix fall-through warnings for Clang

Quoted 7 lines · Marc Kleine-Budde
Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

[]

Quoted 1 line

drivers/net/can/usb/peak_usb/pcan_usb_core.c

Quoted 1 line
drivers/net/can/usb/peak_usb/pcan_usb_core.c +0 -0

[]

drivers/net/can/usb/peak_usb/pcan_usb_core.c

Quoted 14 lines
Quoted 10 lines
drivers/net/can/usb/peak_usb/pcan_usb_core.c +2 -0
@@ -299,6 +299,8 @@ static void peak_usb_write_bulk_callback(struct urb *urb)
  		if (net_ratelimit())
  			netdev_err(netdev, "Tx urb aborted (%d)\n",
  				   urb->status);
+		break;
+

  case -EPROTO:
  case -ENOENT:
  case -ECONNRESET:

What about moving the default to the end if the case, which is more common anyways:

drivers/net/can/usb/peak_usb/pcan_usb_core.c +0 -0

[]

Quoted 15 lines
drivers/net/can/usb/peak_usb/pcan_usb_core.c +0 -0
@@ -295,16 +295,16 @@ static void peak_usb_write_bulk_callback(struct urb *urb)
                 netif_trans_update(netdev);
                 break;

drivers/net/can/usb/peak_usb/pcan_usb_core.c +0 -4
-       default:
-               if (net_ratelimit())
-                       netdev_err(netdev, "Tx urb aborted (%d)\n",
-                                  urb->status);

        case -EPROTO:
        case -ENOENT:
        case -ECONNRESET:
        case -ESHUTDOWN:
-
                break;

drivers/net/can/usb/peak_usb/pcan_usb_core.c static void peak_usb_write_bulk_callback(struct urb *urb) · line 307

Quoted 5 lines
drivers/net/can/usb/peak_usb/pcan_usb_core.c +5 -0
+
+       default:
+               if (net_ratelimit())
+                       netdev_err(netdev, "Tx urb aborted (%d)\n",
+                                  urb->status);

That's fine and is more generally used style but this
default: case should IMO also end with a break;

+ break;

Quoted 1 line

        }

#171 lore raw

Re: [PATCH 072/141] can: peak_usb: Fix fall-through warnings for Clang

Quoted 28 lines · Joe Perches

drivers/net/can/usb/peak_usb/pcan_usb_core.c

Quoted 3 lines

What about moving the default to the end if the case, which is more common anyways:

drivers/net/can/usb/peak_usb/pcan_usb_core.c +0 -0

[]

Quoted 15 lines
drivers/net/can/usb/peak_usb/pcan_usb_core.c +0 -0
@@ -295,16 +295,16 @@ static void peak_usb_write_bulk_callback(struct urb *urb)
                 netif_trans_update(netdev);
                 break;

drivers/net/can/usb/peak_usb/pcan_usb_core.c +0 -4
-       default:
-               if (net_ratelimit())
-                       netdev_err(netdev, "Tx urb aborted (%d)\n",
-                                  urb->status);

        case -EPROTO:
        case -ENOENT:
        case -ECONNRESET:
        case -ESHUTDOWN:
-
                break;

drivers/net/can/usb/peak_usb/pcan_usb_core.c static void peak_usb_write_bulk_callback(struct urb *urb) · line 307

Quoted 5 lines
drivers/net/can/usb/peak_usb/pcan_usb_core.c +5 -0
+
+       default:
+               if (net_ratelimit())
+                       netdev_err(netdev, "Tx urb aborted (%d)\n",
+                                  urb->status);

That's fine and is more generally used style but this
default: case should IMO also end with a break;

Review

Quoted 1 line
(quoted diff) +1 -0
+		break;

I don't mind.

process/coding-style.rst is not totally clear about the break after the default, if this is the lase one the switch statement.

Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
#172 lore raw

Re: [PATCH 072/141] can: peak_usb: Fix fall-through warnings for Clang

Quoted 29 lines · Marc Kleine-Budde
Quoted 28 lines · Joe Perches

drivers/net/can/usb/peak_usb/pcan_usb_core.c

Quoted 3 lines

What about moving the default to the end if the case, which is more common anyways:

drivers/net/can/usb/peak_usb/pcan_usb_core.c +0 -0

[]

Quoted 15 lines
drivers/net/can/usb/peak_usb/pcan_usb_core.c +0 -0
@@ -295,16 +295,16 @@ static void peak_usb_write_bulk_callback(struct urb *urb)
                 netif_trans_update(netdev);
                 break;

drivers/net/can/usb/peak_usb/pcan_usb_core.c +0 -4
-       default:
-               if (net_ratelimit())
-                       netdev_err(netdev, "Tx urb aborted (%d)\n",
-                                  urb->status);

        case -EPROTO:
        case -ENOENT:
        case -ECONNRESET:
        case -ESHUTDOWN:
-
                break;

drivers/net/can/usb/peak_usb/pcan_usb_core.c static void peak_usb_write_bulk_callback(struct urb *urb) · line 307

Quoted 5 lines
drivers/net/can/usb/peak_usb/pcan_usb_core.c +5 -0
+
+       default:
+               if (net_ratelimit())
+                       netdev_err(netdev, "Tx urb aborted (%d)\n",
+                                  urb->status);

That's fine and is more generally used style but this
default: case should IMO also end with a break;

Quoted 6 lines

Review

Quoted 1 line
(quoted diff) +1 -0
+		break;

I don't mind.

process/coding-style.rst is not totally clear about the break after the default, if this is the lase one the switch statement.

deprecated.rst has:

All switch/case blocks must end in one of:

* break;
* fallthrough;
* continue;
* goto <label>;
* return [expression];

I suppose that could be moved into coding-style along with maybe a change to "all switch/case/default blocks"

#173 lore raw

PATCH 73/141 carl9170: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/net/wireless/ath/carl9170/tx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/carl9170/tx.c +1 -0
index 235cf77cd60c..6b8446ff48c8 100644
@@ -840,6 +840,7 @@ static bool carl9170_tx_rts_check(struct ar9170 *ar,
 	case CARL9170_ERP_RTS:
 		if (likely(!multi))
 			return true;
+		break;
 
 	default:
 		break;
Signature · 1 line
2.27.0
#174 lore raw

PATCH 74/141 cfg80211: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/wireless/util.c | 1 +
 1 file changed, 1 insertion(+)
net/wireless/util.c +1 -0
index f01746894a4e..623a4dfb9877 100644
@@ -335,6 +335,7 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
 	case WLAN_CIPHER_SUITE_WEP104:
 		if (key_idx > 3)
 			return -EINVAL;
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#175 lore raw

PATCH 75/141 crypto: ccree - Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---
 drivers/crypto/ccree/cc_cipher.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/crypto/ccree/cc_cipher.c +3 -0
index dafa6577a845..cdfee501fbd9 100644
@@ -97,6 +97,7 @@ static int validate_keys_sizes(struct cc_cipher_ctx *ctx_p, u32 size)
 	case S_DIN_to_SM4:
 		if (size == SM4_KEY_SIZE)
 			return 0;
+		break;
 	default:
 		break;
 	}
@@ -139,9 +140,11 @@ static int validate_data_size(struct cc_cipher_ctx *ctx_p,
 		case DRV_CIPHER_CBC:
 			if (IS_ALIGNED(size, SM4_BLOCK_SIZE))
 				return 0;
+			break;
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
maintainer Acked-by on v1 75/141
#176 lore raw

Re: [PATCH 075/141] crypto: ccree - Fix fall-through warnings for Clang

Quoted 36 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---
 drivers/crypto/ccree/cc_cipher.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/crypto/ccree/cc_cipher.c +3 -1
index dafa6577a845..cdfee501fbd9 100644
@@ -97,6 +97,7 @@ static int validate_keys_sizes(struct cc_cipher_ctx *ctx_p, u32 size)
        case S_DIN_to_SM4:
                if (size == SM4_KEY_SIZE)
                        return 0;
+               break;
        default:
                break;
        }
@@ -139,9 +140,11 @@ static int validate_data_size(struct cc_cipher_ctx *ctx_p,
                case DRV_CIPHER_CBC:
                        if (IS_ALIGNED(size, SM4_BLOCK_SIZE))
                                return 0;
+                       break;
                default:
                        break;
                }
+               break;
        default:
                break;
        }
--
Quoted 2 lines

2.27.0

Thanks,
Gilad

Signature · 4 lines
Gilad Ben-Yossef
Chief Coffee Drinker

values of β will give rise to dom!
#177 lore raw

Re: [PATCH 075/141] crypto: ccree - Fix fall-through warnings for Clang

Quoted 10 lines · Gilad Ben-Yossef
Quoted 8 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---

[..]

Quoted 2 lines

Thanks, Gilad.
--
Gustavo

maintainer
#178 lore raw

Re: [PATCH 075/141] crypto: ccree - Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva
Quoted 9 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---
 drivers/crypto/ccree/cc_cipher.c | 3 +++
 1 file changed, 3 insertions(+)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#179 lore raw

PATCH 76/141 decnet: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/decnet/dn_route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/decnet/dn_route.c +1 -1
index 4cac31d22a50..2f3e5c49a221 100644
@@ -1407,7 +1407,7 @@ static int dn_route_input_slow(struct sk_buff *skb)
 			flags |= RTCF_DOREDIRECT;
 
 		local_src = DN_FIB_RES_PREFSRC(res);
-
+		break;
 	case RTN_BLACKHOLE:
 	case RTN_UNREACHABLE:
 		break;
Signature · 1 line
2.27.0
#180 lore raw

Re: [PATCH 076/141] decnet: Fix fall-through warnings for Clang

Hi all,

It's been more than 3 months; who can take this, please? :)

Thanks
--
Gustavo

Quoted 26 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/decnet/dn_route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/decnet/dn_route.c +1 -1
index 4cac31d22a50..2f3e5c49a221 100644
@@ -1407,7 +1407,7 @@ static int dn_route_input_slow(struct sk_buff *skb)
 			flags |= RTCF_DOREDIRECT;
 
 		local_src = DN_FIB_RES_PREFSRC(res);
-
+		break;
 	case RTN_BLACKHOLE:
 	case RTN_UNREACHABLE:
 		break;
Signature · 1 line
2.27.0
#181 lore raw

PATCH 77/141 dm raid: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/md/dm-raid.c | 1 +
 1 file changed, 1 insertion(+)
drivers/md/dm-raid.c +1 -0
index 9c1f7c4de65b..e98af0b9d00c 100644
@@ -1854,6 +1854,7 @@ static int rs_check_takeover(struct raid_set *rs)
 		    ((mddev->layout == ALGORITHM_PARITY_N && mddev->new_layout == ALGORITHM_PARITY_N) ||
 		     __within_range(mddev->new_layout, ALGORITHM_LEFT_ASYMMETRIC, ALGORITHM_RIGHT_SYMMETRIC)))
 			return 0;
+		break;
 
 	default:
 		break;
Signature · 1 line
2.27.0
#182 lore raw

Re: [PATCH 077/141] dm raid: Fix fall-through warnings for Clang

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 23 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/md/dm-raid.c | 1 +
 1 file changed, 1 insertion(+)
drivers/md/dm-raid.c +1 -0
index 9c1f7c4de65b..e98af0b9d00c 100644
@@ -1854,6 +1854,7 @@ static int rs_check_takeover(struct raid_set *rs)
 		    ((mddev->layout == ALGORITHM_PARITY_N && mddev->new_layout == ALGORITHM_PARITY_N) ||
 		     __within_range(mddev->new_layout, ALGORITHM_LEFT_ASYMMETRIC, ALGORITHM_RIGHT_SYMMETRIC)))
 			return 0;
+		break;
 
 	default:
 		break;
Applied
#183 lore raw

Re: [PATCH 077/141] dm raid: Fix fall-through warnings for Clang

Quoted 29 lines · Gustavo A. R. Silva

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 20 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/md/dm-raid.c | 1 +
 1 file changed, 1 insertion(+)
drivers/md/dm-raid.c +1 -0
index 9c1f7c4de65b..e98af0b9d00c 100644
@@ -1854,6 +1854,7 @@ static int rs_check_takeover(struct raid_set *rs)
 		    ((mddev->layout == ALGORITHM_PARITY_N && mddev->new_layout == ALGORITHM_PARITY_N) ||
 		     __within_range(mddev->new_layout, ALGORITHM_LEFT_ASYMMETRIC, ALGORITHM_RIGHT_SYMMETRIC)))
 			return 0;
+		break;
 
Quoted 4 lines

drivers/md/dm-raid.c static int rs_check_takeover(struct raid_set *rs) · line 1860

Quoted 3 lines
drivers/md/dm-raid.c +0 -0
 	default:
 		break;

I've picked it up for 5.13, thanks.

Mike

#184 lore raw

Re: [PATCH 077/141] dm raid: Fix fall-through warnings for Clang

Quoted 1 line · Mike Snitzer

I've picked it up for 5.13, thanks.

Thanks, Mike.

--
Gustavo

#185 lore raw

PATCH 78/141 drm/amd/pm: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a break statement instead of letting the code fall through to the next case, and a fallthrough pseudo-keyword as a replacement for a /* fall through */ comment,

Notice that Clang doesn't recognize /* fall through */ comments as implicit fall-through markings.

---
 drivers/gpu/drm/amd/pm/powerplay/si_dpm.c                  | 2 +-
 drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/powerplay/si_dpm.c +1 -1
index b5986d19dc08..afa1711c9620 100644
@@ -6200,8 +6200,8 @@ static void si_request_link_speed_change_before_state_change(struct amdgpu_devic
 		case AMDGPU_PCIE_GEN2:
 			if (amdgpu_acpi_pcie_performance_request(adev, PCIE_PERF_REQ_PECI_GEN2, false) == 0)
 				break;
+			fallthrough;
 #endif
-			/* fall through */
 		default:
 			si_pi->force_pcie_gen = si_get_current_pcie_speed(adev);
 			break;
drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c +1 -0
index c3d2e6dcf62a..7d7d698c7976 100644
@@ -2272,6 +2272,7 @@ static int polaris10_update_smc_table(struct pp_hwmgr *hwmgr, uint32_t type)
 		break;
 	case SMU_BIF_TABLE:
 		polaris10_update_bif_smc_table(hwmgr);
+		break;
 	default:
 		break;
 	}
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#186 lore raw

Re: [PATCH 078/141] drm/amd/pm: Fix fall-through warnings for Clang

Quoted 11 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a break statement instead of letting the code fall through to the next case, and a fallthrough pseudo-keyword as a replacement for a /* fall through */ comment,

Notice that Clang doesn't recognize /* fall through */ comments as implicit fall-through markings.

Applied. Thanks!

Alex

Quoted 34 lines
---
 drivers/gpu/drm/amd/pm/powerplay/si_dpm.c                  | 2 +-
 drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/powerplay/si_dpm.c +1 -1
index b5986d19dc08..afa1711c9620 100644
@@ -6200,8 +6200,8 @@ static void si_request_link_speed_change_before_state_change(struct amdgpu_devic
                case AMDGPU_PCIE_GEN2:
                        if (amdgpu_acpi_pcie_performance_request(adev, PCIE_PERF_REQ_PECI_GEN2, false) == 0)
                                break;
+                       fallthrough;
 #endif
-                       /* fall through */
                default:
                        si_pi->force_pcie_gen = si_get_current_pcie_speed(adev);
                        break;
drivers/gpu/drm/amd/pm/powerplay/smumgr/polaris10_smumgr.c +1 -1
index c3d2e6dcf62a..7d7d698c7976 100644
@@ -2272,6 +2272,7 @@ static int polaris10_update_smc_table(struct pp_hwmgr *hwmgr, uint32_t type)
                break;
        case SMU_BIF_TABLE:
                polaris10_update_bif_smc_table(hwmgr);
+               break;
        default:
                break;
        }
--

2.27.0

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#187 lore raw

PATCH 79/141 drm: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/gpu/drm/drm_bufs.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_bufs.c +1 -0
index 7a01d0918861..aeb1327e3077 100644
@@ -77,6 +77,7 @@ static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
 			if ((entry->map->offset & 0xffffffff) ==
 			    (map->offset & 0xffffffff))
 				return entry;
+			break;
 		default: /* Make gcc happy */
 			;
 		}
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#188 lore raw

Re: [PATCH 079/141] drm: Fix fall-through warnings for Clang

Hi Gustavo,

Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

thanks, applied to drm-misc-next.

Sam

Quoted 23 lines
---
 drivers/gpu/drm/drm_bufs.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_bufs.c +1 -0
index 7a01d0918861..aeb1327e3077 100644
@@ -77,6 +77,7 @@ static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
 			if ((entry->map->offset & 0xffffffff) ==
 			    (map->offset & 0xffffffff))
 				return entry;
+			break;
 		default: /* Make gcc happy */
 			;
 		}
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#189 lore raw

Re: [PATCH 079/141] drm: Fix fall-through warnings for Clang

Quoted 10 lines · Sam Ravnborg

Hi Gustavo,

Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

thanks, applied to drm-misc-next.

Thanks, Sam.
--
Gustavo
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#190 lore raw

PATCH 80/141 drm/i915/gem: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a return statement instead of letting the code fall through to the next case.

---
 drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/gem/i915_gem_shrinker.c +1 -0
index dc8f052a0ffe..b699c1adb106 100644
@@ -59,6 +59,7 @@ static void try_to_writeback(struct drm_i915_gem_object *obj,
 	switch (obj->mm.madv) {
 	case I915_MADV_DONTNEED:
 		i915_gem_object_truncate(obj);
+		return;
 	case __I915_MADV_PURGED:
 		return;
 	}
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#191 lore raw

PATCH 81/141 drm/nouveau/clk: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.c +1 -0
index da1770e47490..ae2733035ac2 100644
@@ -313,6 +313,7 @@ nv50_clk_read(struct nvkm_clk *base, enum nv_clk_src src)
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#192 lore raw

PATCH 82/141 drm/nouveau: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a couple of break statements instead of letting the code fall through to the next case.

---
 drivers/gpu/drm/nouveau/nouveau_bo.c        | 1 +
 drivers/gpu/drm/nouveau/nouveau_connector.c | 1 +
 2 files changed, 2 insertions(+)
drivers/gpu/drm/nouveau/nouveau_bo.c +1 -0
index 56b335a55966..037f312c948d 100644
@@ -461,6 +461,7 @@ nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t domain, bool contig)
 			break;
 		case TTM_PL_TT:
 			error |= !(domain & NOUVEAU_GEM_DOMAIN_GART);
+			break;
 		default:
 			break;
 		}
drivers/gpu/drm/nouveau/nouveau_connector.c +1 -0
index 8b4b3688c7ae..585344965504 100644
@@ -157,6 +157,7 @@ nouveau_conn_atomic_set_property(struct drm_connector *connector,
 			default:
 				break;
 			}
+			break;
 		case DRM_MODE_SCALE_FULLSCREEN:
 		case DRM_MODE_SCALE_CENTER:
 		case DRM_MODE_SCALE_ASPECT:
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#193 lore raw

PATCH 83/141 drm/nouveau/therm: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf119.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf119.c +1 -0
index 0981b02790e2..bb2e71bf537f 100644
@@ -41,6 +41,7 @@ pwm_info(struct nvkm_therm *therm, int line)
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#194 lore raw

PATCH 84/141 drm/via: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/gpu/drm/via/via_irq.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/via/via_irq.c +1 -0
index 24cc445169e2..a3e0fb5b8671 100644
@@ -364,6 +364,7 @@ int via_wait_irq(struct drm_device *dev, void *data, struct drm_file *file_priv)
 		irqwait->request.sequence +=
 			atomic_read(&cur_irq->irq_received);
 		irqwait->request.type &= ~_DRM_VBLANK_RELATIVE;
+		break;
 	case VIA_IRQ_ABSOLUTE:
 		break;
 	default:
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#195 lore raw

Re: [PATCH 084/141] drm/via: Fix fall-through warnings for Clang

Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Thanks, also applied to drm-misc-next.

Sam

Quoted 23 lines
---
 drivers/gpu/drm/via/via_irq.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/via/via_irq.c +1 -0
index 24cc445169e2..a3e0fb5b8671 100644
@@ -364,6 +364,7 @@ int via_wait_irq(struct drm_device *dev, void *data, struct drm_file *file_priv)
 		irqwait->request.sequence +=
 			atomic_read(&cur_irq->irq_received);
 		irqwait->request.type &= ~_DRM_VBLANK_RELATIVE;
+		break;
 	case VIA_IRQ_ABSOLUTE:
 		break;
 	default:
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#196 lore raw

Re: [PATCH 084/141] drm/via: Fix fall-through warnings for Clang

Quoted 9 lines · Sam Ravnborg
Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Thanks, also applied to drm-misc-next.

Thank you, Sam.
--
Gustavo

#197 lore raw

PATCH 85/141 firewire: core: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough pseudo-keyword.

---
 drivers/firewire/core-topology.c | 1 +
 1 file changed, 1 insertion(+)
drivers/firewire/core-topology.c +1 -0
index ec68ed27b0a5..b63d55f5ebd3 100644
@@ -58,6 +58,7 @@ static u32 *count_ports(u32 *sid, int *total_port_count, int *child_port_count)
 		case SELFID_PORT_PARENT:
 		case SELFID_PORT_NCONN:
 			(*total_port_count)++;
+			fallthrough;
 		case SELFID_PORT_NONE:
 			break;
 		}
Signature · 1 line
2.27.0
#198 lore raw

PATCH 86/141 hwmon: (corsair-cpro) Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/hwmon/corsair-cpro.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/corsair-cpro.c +1 -0
index 591929ec217a..fa6aa4fc8b52 100644
@@ -310,6 +310,7 @@ static int ccp_write(struct device *dev, enum hwmon_sensor_types type,
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
maintainer Acked-by on v1 86/141
#199 lore raw

Re: [PATCH 086/141] hwmon: (corsair-cpro) Fix fall-through warnings for Clang

Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Quoted 19 lines
---
 drivers/hwmon/corsair-cpro.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/corsair-cpro.c +1 -0
index 591929ec217a..fa6aa4fc8b52 100644
@@ -310,6 +310,7 @@ static int ccp_write(struct device *dev, enum hwmon_sensor_types type,
 		default:
 			break;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#200 lore raw

Re: [PATCH 086/141] hwmon: (corsair-cpro) Fix fall-through warnings for Clang

Quoted 9 lines · Guenter Roeck
Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

[]

Quoted 1 line

drivers/hwmon/corsair-cpro.c

Quoted 1 line
drivers/hwmon/corsair-cpro.c +0 -0

[]

Quoted 5 lines

drivers/hwmon/corsair-cpro.c

Quoted 5 lines
drivers/hwmon/corsair-cpro.c +0 -0
@@ -310,6 +310,7 @@ static int ccp_write(struct device *dev, enum hwmon_sensor_types type,

  default:
  break;
  }

drivers/hwmon/corsair-cpro.c +1 -0
+		break;

The

		default:
			break;

bit above (but not below as it's a switch on an enum) could also be deleted no?

Quoted 3 lines
Quoted 3 lines

  default:
  break;
  }

---
 drivers/hwmon/corsair-cpro.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/hwmon/corsair-cpro.c +1 -4
index 591929ec217a..580173fca0f6 100644
@@ -299,17 +299,14 @@ static int ccp_write(struct device *dev, enum hwmon_sensor_types type,
 		switch (attr) {
 		case hwmon_pwm_input:
 			return set_pwm(ccp, channel, val);
-		default:
-			break;
 		}
 		break;
 	case hwmon_fan:
 		switch (attr) {
 		case hwmon_fan_target:
 			return set_target(ccp, channel, val);
-		default:
-			break;
 		}
+		break;
 	default:
 		break;
 	}
maintainer
#201 lore raw

Re: [PATCH 086/141] hwmon: (corsair-cpro) Fix fall-through warnings for Clang

Quoted 20 lines · Joe Perches
Quoted 9 lines · Guenter Roeck
Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

[]

Quoted 1 line

drivers/hwmon/corsair-cpro.c

Quoted 1 line
drivers/hwmon/corsair-cpro.c +0 -0

[]

Quoted 5 lines

drivers/hwmon/corsair-cpro.c static int ccp_write(struct device *dev, enum hwmon_sensor_types type, · line 309

Quoted 5 lines
drivers/hwmon/corsair-cpro.c +0 -0
@@ -310,6 +310,7 @@ static int ccp_write(struct device *dev, enum hwmon_sensor_types type,

  default:
  break;
  }

drivers/hwmon/corsair-cpro.c +1 -0
+		break;

The

Quoted 5 lines
		default:
			break;

bit above (but not below as it's a switch on an enum) could also be deleted no?

I prefer to keep it the way it is to indicate that the default case was not forgotten (unless that is against coding style).

Guenter

Quoted 33 lines
Quoted 3 lines
Quoted 3 lines

  default:
  break;
  }

---
 drivers/hwmon/corsair-cpro.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/hwmon/corsair-cpro.c +1 -4
index 591929ec217a..580173fca0f6 100644
@@ -299,17 +299,14 @@ static int ccp_write(struct device *dev, enum hwmon_sensor_types type,
 		switch (attr) {
 		case hwmon_pwm_input:
 			return set_pwm(ccp, channel, val);
-		default:
-			break;
 		}
 		break;
 	case hwmon_fan:
 		switch (attr) {
 		case hwmon_fan_target:
 			return set_target(ccp, channel, val);
-		default:
-			break;
 		}
+		break;
 	default:
 		break;
 	}
#202 lore raw

Re: [PATCH 086/141] hwmon: (corsair-cpro) Fix fall-through warnings for Clang

In reply to Guenter Roeck
Quoted 9 lines · Guenter Roeck
Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Thanks, Guenter.
--
Gustavo

#203 lore raw

PATCH 87/141 hwmon: (max6621) Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/hwmon/max6621.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/max6621.c +1 -1
index 367855d5edae..7821132e17fa 100644
@@ -156,7 +156,7 @@ max6621_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr,
 		default:
 			break;
 		}
-
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
maintainer Acked-by on v1 87/141
#204 lore raw

Re: [PATCH 087/141] hwmon: (max6621) Fix fall-through warnings for Clang

Quoted 6 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Quoted 20 lines
---
 drivers/hwmon/max6621.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/max6621.c +1 -1
index 367855d5edae..7821132e17fa 100644
@@ -156,7 +156,7 @@ max6621_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr,
 		default:
 			break;
 		}
-
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#205 lore raw

PATCH 88/141 i3c: master: cdns: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/i3c/master/i3c-master-cdns.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/i3c/master/i3c-master-cdns.c +2 -0
index 3f2226928fe0..5b37ffe5ad5b 100644
@@ -1379,6 +1379,8 @@ static void cnds_i3c_master_demux_ibis(struct cdns_i3c_master *master)
 
 		case IBIR_TYPE_MR:
 			WARN_ON(IBIR_XFER_BYTES(ibir) || (ibir & IBIR_ERROR));
+			break;
+
 		default:
 			break;
 		}
Signature · 1 line
2.27.0
#206 lore raw

PATCH 89/141 ide: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/ide/siimage.c | 1 +
 1 file changed, 1 insertion(+)
drivers/ide/siimage.c +1 -0
index c4b20f350b84..145c0ab3a856 100644
@@ -493,6 +493,7 @@ static int init_chipset_siimage(struct pci_dev *dev)
 	case 0x30:
 		/* Clocking is disabled, attempt to force 133MHz clocking. */
 		sil_iowrite8(dev, tmp & ~0x20, scsc_addr);
+		break;
 	case 0x10:
 		/* On 133Mhz clocking. */
 		break;
Signature · 1 line
2.27.0
#207 lore raw

PATCH 90/141 iio: adc: cpcap: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/iio/adc/cpcap-adc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/adc/cpcap-adc.c +1 -0
index 64c3cc382311..f19c9aa93f17 100644
@@ -557,6 +557,7 @@ static void cpcap_adc_setup_bank(struct cpcap_adc *ddata,
 		break;
 	case CPCAP_ADC_BATTP_PI16 ... CPCAP_ADC_BATTI_PI17:
 		value1 |= CPCAP_BIT_RAND1;
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
maintainer Applied
#208 lore raw

Re: [PATCH 090/141] iio: adc: cpcap: Fix fall-through warnings for Clang

Quoted 6 lines · On Fri, 20 Nov 2020 12:36:26 -0600 "Gustavo A. R. Silva"…

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Hi Gustavo,

I'm assuming there is no 'huge' rush for these an intent is that they will filter through the various subsystems. Hence I've queued it up for the next merge window.

Applied to the togreg branch of iio.git

Thanks,

Jonathan

Quoted 16 lines
---
 drivers/iio/adc/cpcap-adc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/adc/cpcap-adc.c +1 -0
index 64c3cc382311..f19c9aa93f17 100644
@@ -557,6 +557,7 @@ static void cpcap_adc_setup_bank(struct cpcap_adc *ddata,
 		break;
 	case CPCAP_ADC_BATTP_PI16 ... CPCAP_ADC_BATTI_PI17:
 		value1 |= CPCAP_BIT_RAND1;
+		break;
 	default:
 		break;
 	}
#209 lore raw

Re: [PATCH 090/141] iio: adc: cpcap: Fix fall-through warnings for Clang

Quoted 10 lines · Jonathan Cameron
Quoted 6 lines · On Fri, 20 Nov 2020 12:36:26 -0600 "Gustavo A. R. Silva"…

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Hi Gustavo,

Hi Jonathan,

Quoted 3 lines

I'm assuming there is no 'huge' rush for these an intent is that they will filter through the various subsystems. Hence I've queued it up for the next merge window.

Yep; no rush for this.

Quoted 1 line

Applied to the togreg branch of iio.git

Thank you!
--
Gustavo

#210 lore raw

PATCH 91/141 iwlwifi: iwl-drv: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by replacing a /* fall through */ comment with the new pseudo-keyword macro fallthrough; instead of letting the code fall through to the next case.

Notice that Clang doesn't recognize /* fall through */ comments as implicit fall-through markings.

---
 drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +1 -1
index 9dcd2e990c9c..6a9be73d7661 100644
@@ -1579,7 +1579,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
 		break;
 	default:
 		WARN(1, "Invalid fw type %d\n", fw->type);
-		/* fall through */
+		fallthrough;
 	case IWL_FW_MVM:
 		op = &iwlwifi_opmode_table[MVM_OP_MODE];
 		break;
Signature · 1 line
2.27.0
#211 lore raw

Re: [PATCH 091/141] iwlwifi: iwl-drv: Fix fall-through warnings for Clang

Quoted 10 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by replacing a /* fall through */ comment with the new pseudo-keyword macro fallthrough; instead of letting the code fall through to the next case.

Notice that Clang doesn't recognize /* fall through */ comments as implicit fall-through markings.

Patch applied to wireless-drivers-next.git, thanks.

10a0472d1850 iwlwifi: iwl-drv: Fix fall-through warnings for Clang

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/edd98d194bfc98b4be93a9bdc303630b719c0e66.1605896060.git.gustavoars@kernel.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#212 lore raw

PATCH 92/141 libata: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/ata/libata-eh.c | 1 +
 1 file changed, 1 insertion(+)
drivers/ata/libata-eh.c +1 -0
index b6f92050e60c..2db1e9c66088 100644
@@ -2613,6 +2613,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
 			switch (tmp) {
 			case -EAGAIN:
 				rc = -EAGAIN;
+				break;
 			case 0:
 				break;
 			default:
Signature · 1 line
2.27.0
#213 lore raw

Re: [PATCH 092/141] libata: Fix fall-through warnings for Clang

Hi all,

Friendly ping: who can take this, please?

Thanks
--
Gustavo

Quoted 23 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/ata/libata-eh.c | 1 +
 1 file changed, 1 insertion(+)
drivers/ata/libata-eh.c +1 -0
index b6f92050e60c..2db1e9c66088 100644
@@ -2613,6 +2613,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
 			switch (tmp) {
 			case -EAGAIN:
 				rc = -EAGAIN;
+				break;
 			case 0:
 				break;
 			default:
maintainer
#214 lore raw

Re: [PATCH 092/141] libata: Fix fall-through warnings for Clang

Quoted 3 lines · Gustavo A. R. Silva

Hi all,

Friendly ping: who can take this, please?

Applied for 5.13.

Signature · 1 line
Jens Axboe
#215 lore raw

Re: [PATCH 092/141] libata: Fix fall-through warnings for Clang

Quoted 7 lines · Jens Axboe
Quoted 3 lines · Gustavo A. R. Silva

Hi all,

Friendly ping: who can take this, please?

Applied for 5.13.

Thanks, Jens.

--
Gustavo

#216 lore raw

PATCH 93/141 mac80211: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---
 net/mac80211/cfg.c | 2 ++
 1 file changed, 2 insertions(+)
net/mac80211/cfg.c +2 -0
index 7276e66ae435..1d1a4f3c8d66 100644
@@ -405,6 +405,7 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
 	case WLAN_CIPHER_SUITE_WEP104:
 		if (WARN_ON_ONCE(fips_enabled))
 			return -EINVAL;
+		break;
 	case WLAN_CIPHER_SUITE_CCMP:
 	case WLAN_CIPHER_SUITE_CCMP_256:
 	case WLAN_CIPHER_SUITE_AES_CMAC:
@@ -3307,6 +3308,7 @@ static int ieee80211_set_csa_beacon(struct ieee80211_sub_if_data *sdata,
 			if (cfg80211_get_chandef_type(&params->chandef) !=
 			    cfg80211_get_chandef_type(&sdata->u.ibss.chandef))
 				return -EINVAL;
+			break;
 		case NL80211_CHAN_WIDTH_5:
 		case NL80211_CHAN_WIDTH_10:
 		case NL80211_CHAN_WIDTH_20_NOHT:
Signature · 1 line
2.27.0
#217 lore raw

PATCH 94/141 media: atomisp: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c +1 -0
index b4813cd50daa..4a18da6bf0c1 100644
@@ -368,6 +368,7 @@ static mipi_predictor_t sh_css_csi2_compression_type_2_mipi_predictor(
 		break;
 	case IA_CSS_CSI2_COMPRESSION_TYPE_2:
 		predictor = MIPI_PREDICTOR_TYPE2 - 1;
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
Reviewed-by on v1 94/141
#218 lore raw

Re: [PATCH 094/141] media: atomisp: Fix fall-through warnings for Clang

Em Fri, 20 Nov 2020 12:36:50 -0600
"Gustavo A. R. Silva" <[email protected]> escreveu:

Quoted 6 lines

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Quoted 9 lines
---
 drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c +0 -0
index b4813cd50daa..4a18da6bf0c1 100644

drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c static mipi_predictor_t sh_css_csi2_compression_type_2_mipi_predictor( · line 374

Quoted 7 lines
drivers/staging/media/atomisp/pci/runtime/isys/src/rx.c +1 -0
@@ -368,6 +368,7 @@ static mipi_predictor_t sh_css_csi2_compression_type_2_mipi_predictor(
 		break;
 	case IA_CSS_CSI2_COMPRESSION_TYPE_2:
 		predictor = MIPI_PREDICTOR_TYPE2 - 1;
+		break;
 	default:
 		break;
 	}

Thanks,
Mauro

#219 lore raw

PATCH 95/141 media: dvb_frontend: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/media/dvb-core/dvb_frontend.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/dvb-core/dvb_frontend.c +1 -0
index 06ea30a689d7..fb35697dd93c 100644
@@ -984,6 +984,7 @@ static int dvb_frontend_check_parameters(struct dvb_frontend *fe)
 				 fe->ops.info.symbol_rate_max);
 			return -EINVAL;
 		}
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
Reviewed-by on v1 95/141
#220 lore raw

Re: [PATCH 095/141] media: dvb_frontend: Fix fall-through warnings for Clang

Em Fri, 20 Nov 2020 12:36:57 -0600
"Gustavo A. R. Silva" <[email protected]> escreveu:

Quoted 6 lines

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Quoted 9 lines
---
 drivers/media/dvb-core/dvb_frontend.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/dvb-core/dvb_frontend.c +0 -0
index 06ea30a689d7..fb35697dd93c 100644

drivers/media/dvb-core/dvb_frontend.c static int dvb_frontend_check_parameters(struct dvb_frontend *fe) · line 990

Quoted 7 lines
drivers/media/dvb-core/dvb_frontend.c +1 -0
@@ -984,6 +984,7 @@ static int dvb_frontend_check_parameters(struct dvb_frontend *fe)
 				 fe->ops.info.symbol_rate_max);
 			return -EINVAL;
 		}
+		break;
 	default:
 		break;
 	}

Thanks,
Mauro

#221 lore raw

PATCH 96/141 media: rcar_jpu: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/media/platform/rcar_jpu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/rcar_jpu.c +1 -0
index 9b99ff368698..87466edf8a5e 100644
@@ -648,6 +648,7 @@ static u8 jpu_parse_hdr(void *buffer, unsigned long size, unsigned int *width,
 			if (get_word_be(&jpeg_buffer, &word))
 				return 0;
 			skip(&jpeg_buffer, (long)word - 2);
+			break;
 		case 0:
 			break;
 		default:
Signature · 1 line
2.27.0
Reviewed-by on v1 96/141
#222 lore raw

Re: [PATCH 096/141] media: rcar_jpu: Fix fall-through warnings for Clang

Em Fri, 20 Nov 2020 12:37:02 -0600
"Gustavo A. R. Silva" <[email protected]> escreveu:

Quoted 6 lines

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Quoted 9 lines
---
 drivers/media/platform/rcar_jpu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/rcar_jpu.c +0 -0
index 9b99ff368698..87466edf8a5e 100644

drivers/media/platform/rcar_jpu.c static u8 jpu_parse_hdr(void *buffer, unsigned long size, unsigned int *width, · line 654

Quoted 7 lines
drivers/media/platform/rcar_jpu.c +1 -0
@@ -648,6 +648,7 @@ static u8 jpu_parse_hdr(void *buffer, unsigned long size, unsigned int *width,
 			if (get_word_be(&jpeg_buffer, &word))
 				return 0;
 			skip(&jpeg_buffer, (long)word - 2);
+			break;
 		case 0:
 			break;
 		default:

Thanks,
Mauro

#223 lore raw

PATCH 97/141 media: saa7134: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/media/pci/saa7134/saa7134-tvaudio.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/pci/saa7134/saa7134-tvaudio.c +1 -0
index 5cc4ef21f9d3..5dc97990fa0e 100644
@@ -885,6 +885,7 @@ void saa7134_enable_i2s(struct saa7134_dev *dev)
 	    saa_writeb(SAA7134_I2S_OUTPUT_FORMAT, i2s_format);
 	    saa_writeb(SAA7134_I2S_OUTPUT_LEVEL,  0x0F);
 	    saa_writeb(SAA7134_I2S_AUDIO_OUTPUT,  0x01);
+	    break;
 
 	default:
 	    break;
Signature · 1 line
2.27.0
Reviewed-by on v1 97/141
#224 lore raw

Re: [PATCH 097/141] media: saa7134: Fix fall-through warnings for Clang

Em Fri, 20 Nov 2020 12:37:08 -0600
"Gustavo A. R. Silva" <[email protected]> escreveu:

Quoted 6 lines

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Quoted 9 lines
---
 drivers/media/pci/saa7134/saa7134-tvaudio.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/pci/saa7134/saa7134-tvaudio.c +0 -0
index 5cc4ef21f9d3..5dc97990fa0e 100644

drivers/media/pci/saa7134/saa7134-tvaudio.c void saa7134_enable_i2s(struct saa7134_dev *dev) · line 891

Quoted 7 lines
drivers/media/pci/saa7134/saa7134-tvaudio.c +1 -0
@@ -885,6 +885,7 @@ void saa7134_enable_i2s(struct saa7134_dev *dev)
 	    saa_writeb(SAA7134_I2S_OUTPUT_FORMAT, i2s_format);
 	    saa_writeb(SAA7134_I2S_OUTPUT_LEVEL,  0x0F);
 	    saa_writeb(SAA7134_I2S_AUDIO_OUTPUT,  0x01);
+	    break;
 
 	default:
 	    break;

Thanks,
Mauro

#225 lore raw

PATCH 98/141 mmc: sdhci-of-arasan: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---
 drivers/mmc/host/sdhci-of-arasan.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/host/sdhci-of-arasan.c +4 -0
index 829ccef87426..1f7e42b6ced5 100644
@@ -627,6 +627,7 @@ static int sdhci_zynqmp_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
 	case MMC_TIMING_MMC_HS200:
 		/* For 200MHz clock, 8 Taps are available */
 		tap_max = 8;
+		break;
 	default:
 		break;
 	}
@@ -695,6 +696,7 @@ static int sdhci_zynqmp_sampleclk_set_phase(struct clk_hw *hw, int degrees)
 	case MMC_TIMING_MMC_HS200:
 		/* For 200MHz clock, 30 Taps are available */
 		tap_max = 30;
+		break;
 	default:
 		break;
 	}
@@ -760,6 +762,7 @@ static int sdhci_versal_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
 	case MMC_TIMING_MMC_HS200:
 		/* For 200MHz clock, 8 Taps are available */
 		tap_max = 8;
+		break;
 	default:
 		break;
 	}
@@ -831,6 +834,7 @@ static int sdhci_versal_sampleclk_set_phase(struct clk_hw *hw, int degrees)
 	case MMC_TIMING_MMC_HS200:
 		/* For 200MHz clock, 30 Taps are available */
 		tap_max = 30;
+		break;
 	default:
 		break;
 	}
Signature · 7 lines
2.27.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Acked-by on v1 98/141
#226 lore raw

Re: [PATCH 098/141] mmc: sdhci-of-arasan: Fix fall-through warnings for Clang

Quoted 40 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---
 drivers/mmc/host/sdhci-of-arasan.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/host/sdhci-of-arasan.c +3 -0
index 829ccef87426..1f7e42b6ced5 100644
@@ -627,6 +627,7 @@ static int sdhci_zynqmp_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
 	case MMC_TIMING_MMC_HS200:
 		/* For 200MHz clock, 8 Taps are available */
 		tap_max = 8;
+		break;
 	default:
 		break;
 	}
@@ -695,6 +696,7 @@ static int sdhci_zynqmp_sampleclk_set_phase(struct clk_hw *hw, int degrees)
 	case MMC_TIMING_MMC_HS200:
 		/* For 200MHz clock, 30 Taps are available */
 		tap_max = 30;
+		break;
 	default:
 		break;
 	}
@@ -760,6 +762,7 @@ static int sdhci_versal_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
 	case MMC_TIMING_MMC_HS200:
 		/* For 200MHz clock, 8 Taps are available */
 		tap_max = 8;
+		break;
 	default:
 		break;
 	}

drivers/mmc/host/sdhci-of-arasan.c static int sdhci_versal_sampleclk_set_phase(struct clk_hw *hw, int degrees) · line 840

Quoted 7 lines
drivers/mmc/host/sdhci-of-arasan.c +1 -0
@@ -831,6 +834,7 @@ static int sdhci_versal_sampleclk_set_phase(struct clk_hw *hw, int degrees)
 	case MMC_TIMING_MMC_HS200:
 		/* For 200MHz clock, 30 Taps are available */
 		tap_max = 30;
+		break;
 	default:
 		break;
 	}

No problem with it.

Thanks,
Michal

#227 lore raw

Re: [PATCH 098/141] mmc: sdhci-of-arasan: Fix fall-through warnings for Clang

Quoted 53 lines · Michal Simek
Quoted 40 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---
 drivers/mmc/host/sdhci-of-arasan.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/host/sdhci-of-arasan.c +3 -0
index 829ccef87426..1f7e42b6ced5 100644
@@ -627,6 +627,7 @@ static int sdhci_zynqmp_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
 	case MMC_TIMING_MMC_HS200:
 		/* For 200MHz clock, 8 Taps are available */
 		tap_max = 8;
+		break;
 	default:
 		break;
 	}
@@ -695,6 +696,7 @@ static int sdhci_zynqmp_sampleclk_set_phase(struct clk_hw *hw, int degrees)
 	case MMC_TIMING_MMC_HS200:
 		/* For 200MHz clock, 30 Taps are available */
 		tap_max = 30;
+		break;
 	default:
 		break;
 	}
@@ -760,6 +762,7 @@ static int sdhci_versal_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
 	case MMC_TIMING_MMC_HS200:
 		/* For 200MHz clock, 8 Taps are available */
 		tap_max = 8;
+		break;
 	default:
 		break;
 	}

drivers/mmc/host/sdhci-of-arasan.c static int sdhci_versal_sampleclk_set_phase(struct clk_hw *hw, int degrees) · line 840

Quoted 7 lines
drivers/mmc/host/sdhci-of-arasan.c +1 -0
@@ -831,6 +834,7 @@ static int sdhci_versal_sampleclk_set_phase(struct clk_hw *hw, int degrees)
 	case MMC_TIMING_MMC_HS200:
 		/* For 200MHz clock, 30 Taps are available */
 		tap_max = 30;
+		break;
 	default:
 		break;
 	}

No problem with it.

Quoted 1 line

Thanks, Michal.
--
Gustavo

#228 lore raw

Re: [PATCH 098/141] mmc: sdhci-of-arasan: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva
Quoted 7 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

Applied for next, thanks!

Kind regards
Uffe

Quoted 43 lines
---
 drivers/mmc/host/sdhci-of-arasan.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/host/sdhci-of-arasan.c +4 -1
index 829ccef87426..1f7e42b6ced5 100644
@@ -627,6 +627,7 @@ static int sdhci_zynqmp_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
        case MMC_TIMING_MMC_HS200:
                /* For 200MHz clock, 8 Taps are available */
                tap_max = 8;
+               break;
        default:
                break;
        }
@@ -695,6 +696,7 @@ static int sdhci_zynqmp_sampleclk_set_phase(struct clk_hw *hw, int degrees)
        case MMC_TIMING_MMC_HS200:
                /* For 200MHz clock, 30 Taps are available */
                tap_max = 30;
+               break;
        default:
                break;
        }
@@ -760,6 +762,7 @@ static int sdhci_versal_sdcardclk_set_phase(struct clk_hw *hw, int degrees)
        case MMC_TIMING_MMC_HS200:
                /* For 200MHz clock, 8 Taps are available */
                tap_max = 8;
+               break;
        default:
                break;
        }
@@ -831,6 +834,7 @@ static int sdhci_versal_sampleclk_set_phase(struct clk_hw *hw, int degrees)
        case MMC_TIMING_MMC_HS200:
                /* For 200MHz clock, 30 Taps are available */
                tap_max = 30;
+               break;
        default:
                break;
        }
--

2.27.0

#229 lore raw

Re: [PATCH 098/141] mmc: sdhci-of-arasan: Fix fall-through warnings for Clang

Quoted 10 lines · Ulf Hansson
Quoted 7 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

Applied for next, thanks!

Thank you, Uffe.
--
Gustavo

#230 lore raw

PATCH 99/141 mt76: mt7615: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by replacing a /* fall through */ comment with the new pseudo-keyword macro fallthrough; instead of letting the code fall through to the next case.

Notice that Clang doesn't recognize /* fall through */ comments as implicit fall-through markings.

---
 drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c +1 -1
index f4756bb946c3..9a9685e5ab84 100644
@@ -127,7 +127,7 @@ mt7615_eeprom_parse_hw_band_cap(struct mt7615_dev *dev)
 		break;
 	case MT_EE_DBDC:
 		dev->dbdc_support = true;
-		/* fall through */
+		fallthrough;
 	default:
 		dev->mt76.cap.has_2ghz = true;
 		dev->mt76.cap.has_5ghz = true;
Signature · 7 lines
2.27.0


_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
#231 lore raw

PATCH 100/141 mtd: cfi: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements and a return instead of letting the code fall through to the next case.

---
 drivers/mtd/chips/cfi_cmdset_0001.c | 1 +
 drivers/mtd/chips/cfi_cmdset_0002.c | 2 ++
 drivers/mtd/chips/cfi_cmdset_0020.c | 2 ++
 3 files changed, 5 insertions(+)
drivers/mtd/chips/cfi_cmdset_0001.c +1 -0
index 42001c49833b..b7f5e7977dcd 100644
@@ -2549,6 +2549,7 @@ static int cfi_intelext_suspend(struct mtd_info *mtd)
 			   anyway? The latter for now. */
 			printk(KERN_NOTICE "Flash device refused suspend due to active operation (state %d)\n", chip->state);
 			ret = -EAGAIN;
+			break;
 		case FL_PM_SUSPENDED:
 			break;
 		}
drivers/mtd/chips/cfi_cmdset_0002.c +2 -0
index a1f3e1031c3d..6f6b0265c22d 100644
@@ -902,6 +902,7 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
 			/* Someone else might have been playing with it. */
 			goto retry;
 		}
+		return 0;
 
 	case FL_READY:
 	case FL_CFI_QUERY:
@@ -2994,6 +2995,7 @@ static int cfi_amdstd_suspend(struct mtd_info *mtd)
 			 * as the whole point is that nobody can do anything
 			 * with the chip now anyway.
 			 */
+			break;
 		case FL_PM_SUSPENDED:
 			break;
 
drivers/mtd/chips/cfi_cmdset_0020.c +2 -0
index 270322bca221..d35df526e0a6 100644
@@ -1332,6 +1332,8 @@ static int cfi_staa_suspend(struct mtd_info *mtd)
 			 * as the whole point is that nobody can do anything
 			 * with the chip now anyway.
 			 */
+			break;
+
 		case FL_PM_SUSPENDED:
 			break;
 
Signature · 6 lines
2.27.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#232 lore raw

PATCH 101/141 mtd: mtdchar: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/mtd/mtdchar.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/mtdchar.c +1 -0
index b40f46a43fc6..a306659ea683 100644
@@ -993,6 +993,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
 			if (!mtd_has_oob(mtd))
 				return -EOPNOTSUPP;
 			mfi->mode = arg;
+			break;
 
 		case MTD_FILE_MODE_NORMAL:
 			break;
Signature · 6 lines
2.27.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#233 lore raw

PATCH 102/141 mtd: onenand: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/mtd/nand/onenand/onenand_samsung.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/onenand/onenand_samsung.c +1 -0
index 87b28e397d67..b64895573515 100644
@@ -396,6 +396,7 @@ static int s3c_onenand_command(struct mtd_info *mtd, int cmd, loff_t addr,
 	case ONENAND_CMD_READOOB:
 	case ONENAND_CMD_BUFFERRAM:
 		ONENAND_SET_NEXT_BUFFERRAM(this);
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#234 lore raw

PATCH 103/141 mtd: rawnand: fsmc: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/mtd/nand/raw/fsmc_nand.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/raw/fsmc_nand.c +1 -0
index 4191831df182..273626d49769 100644
@@ -916,6 +916,7 @@ static int fsmc_nand_attach_chip(struct nand_chip *nand)
 				 "Using 4-bit SW BCH ECC scheme\n");
 			break;
 		}
+		break;
 
 	case NAND_ECC_ENGINE_TYPE_ON_DIE:
 		break;
Signature · 6 lines
2.27.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#235 lore raw

PATCH 104/141 mtd: rawnand: stm32_fmc2: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a couple of fallthrough pseudo-keywords instead of letting the code fall through to the next case.

---
 drivers/mtd/nand/raw/stm32_fmc2_nand.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mtd/nand/raw/stm32_fmc2_nand.c +2 -0
index 550bda4d1415..002fa521036f 100644
@@ -531,6 +531,7 @@ static int stm32_fmc2_nfc_ham_correct(struct nand_chip *chip, u8 *dat,
 		switch (b % 4) {
 		case 2:
 			bit_position += shifting;
+			fallthrough;
 		case 1:
 			break;
 		default:
@@ -546,6 +547,7 @@ static int stm32_fmc2_nfc_ham_correct(struct nand_chip *chip, u8 *dat,
 		switch (b % 4) {
 		case 2:
 			byte_addr += shifting;
+			fallthrough;
 		case 1:
 			break;
 		default:
Signature · 7 lines
2.27.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#236 lore raw

Re: [PATCH 104/141] mtd: rawnand: stm32_fmc2: Fix fall-through warnings for Clang

Hi Gustavo,

"Gustavo A. R. Silva" <[email protected]> wrote on Fri, 20 Nov 2020 12:37:48 -0600:

Quoted 15 lines

In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a couple of fallthrough pseudo-keywords instead of letting the code fall through to the next case.

---
 drivers/mtd/nand/raw/stm32_fmc2_nand.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mtd/nand/raw/stm32_fmc2_nand.c +0 -0
index 550bda4d1415..002fa521036f 100644

drivers/mtd/nand/raw/stm32_fmc2_nand.c static int stm32_fmc2_nfc_ham_correct(struct nand_chip *chip, u8 *dat, · line 534

Quoted 4 lines
drivers/mtd/nand/raw/stm32_fmc2_nand.c +1 -0
@@ -531,6 +531,7 @@ static int stm32_fmc2_nfc_ham_correct(struct nand_chip *chip, u8 *dat,
 		switch (b % 4) {
 		case 2:
 			bit_position += shifting;
+			fallthrough;

In patch 100, 101, 102, 103 you 'break' in this case (when the statement falls into the empty following statement which itself breaks). Please make it consistent and use break here, below, and in patch 132.

LGTM otherwise.

drivers/mtd/nand/raw/stm32_fmc2_nand.c static int stm32_fmc2_nfc_ham_correct(struct nand_chip *chip, u8 *dat, · line 553

Quoted 11 lines
drivers/mtd/nand/raw/stm32_fmc2_nand.c +1 -0
 		case 1:
 			break;
 		default:
@@ -546,6 +547,7 @@ static int stm32_fmc2_nfc_ham_correct(struct nand_chip *chip, u8 *dat,
 		switch (b % 4) {
 		case 2:
 			byte_addr += shifting;
+			fallthrough;
 		case 1:
 			break;
 		default:

Thanks,
Miquèl

#237 lore raw

Re: [PATCH 104/141] mtd: rawnand: stm32_fmc2: Fix fall-through warnings for Clang

Hi Miquel,

Quoted 15 lines · Miquel Raynal

Hi Gustavo,

"Gustavo A. R. Silva" <[email protected]> wrote on Fri, 20 Nov 2020 12:37:48 -0600:

Quoted 10 lines

In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple of warnings by explicitly adding a couple of fallthrough pseudo-keywords instead of letting the code fall through to the next case.

---
 drivers/mtd/nand/raw/stm32_fmc2_nand.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 14 lines

drivers/mtd/nand/raw/stm32_fmc2_nand.c static int stm32_fmc2_nfc_ham_correct(struct nand_chip *chip, u8 *dat, · line 534

Quoted 9 lines
drivers/mtd/nand/raw/stm32_fmc2_nand.c +1 -0
index 550bda4d1415..002fa521036f 100644
@@ -531,6 +531,7 @@ static int stm32_fmc2_nfc_ham_correct(struct nand_chip *chip, u8 *dat,
 		switch (b % 4) {
 		case 2:
 			bit_position += shifting;
+			fallthrough;

In patch 100, 101, 102, 103 you 'break' in this case (when the statement falls into the empty following statement which itself breaks). Please make it consistent and use break here, below, and in patch 132.

I'll address this and send separate patches.

Quoted 1 line

LGTM otherwise.

Thanks!
--
Gustavo

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#238 lore raw

PATCH 105/141 net: ax25: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/ax25/af_ax25.c | 1 +
 1 file changed, 1 insertion(+)
net/ax25/af_ax25.c +1 -0
index 269ee89d2c2b..2631efc6e359 100644
@@ -850,6 +850,7 @@ static int ax25_create(struct net *net, struct socket *sock, int protocol,
 		case AX25_P_ROSE:
 			if (ax25_protocol_is_registered(AX25_P_ROSE))
 				return -ESOCKTNOSUPPORT;
+			break;
 #endif
 		default:
 			break;
Signature · 1 line
2.27.0
#239 lore raw

Re: [PATCH 105/141] net: ax25: Fix fall-through warnings for Clang

Hi all,

It's been more than 3 months; who can take this, please? :)

Thanks
--
Gustavo

Quoted 25 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/ax25/af_ax25.c | 1 +
 1 file changed, 1 insertion(+)
net/ax25/af_ax25.c +1 -0
index 269ee89d2c2b..2631efc6e359 100644
@@ -850,6 +850,7 @@ static int ax25_create(struct net *net, struct socket *sock, int protocol,
 		case AX25_P_ROSE:
 			if (ax25_protocol_is_registered(AX25_P_ROSE))
 				return -ESOCKTNOSUPPORT;
+			break;
 #endif
 		default:
 			break;
Signature · 1 line
2.27.0
#240 lore raw

PATCH 106/141 net: bridge: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/bridge/br_input.c | 1 +
 1 file changed, 1 insertion(+)
net/bridge/br_input.c +1 -0
index 59a318b9f646..8db219d979c5 100644
@@ -148,6 +148,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
 		break;
 	case BR_PKT_UNICAST:
 		dst = br_fdb_find_rcu(br, eth_hdr(skb)->h_dest, vid);
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#241 lore raw

Re: [Bridge] [PATCH 106/141] net: bridge: Fix fall-through warnings for Clang

Hi all,

Who can take this? :)

Thanks
--
Gustavo

Quoted 23 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/bridge/br_input.c | 1 +
 1 file changed, 1 insertion(+)
net/bridge/br_input.c +1 -0
index 59a318b9f646..8db219d979c5 100644
@@ -148,6 +148,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
 		break;
 	case BR_PKT_UNICAST:
 		dst = br_fdb_find_rcu(br, eth_hdr(skb)->h_dest, vid);
+		break;
 	default:
 		break;
 	}
Acked-by on v1 106/141
#242 lore raw

Re: [PATCH 106/141] net: bridge: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva
Quoted 16 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/bridge/br_input.c | 1 +
 1 file changed, 1 insertion(+)
net/bridge/br_input.c +0 -0
index 59a318b9f646..8db219d979c5 100644

net/bridge/br_input.c int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb · line 154

Quoted 7 lines
net/bridge/br_input.c +1 -0
@@ -148,6 +148,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
 		break;
 	case BR_PKT_UNICAST:
 		dst = br_fdb_find_rcu(br, eth_hdr(skb)->h_dest, vid);
+		break;
 	default:
 		break;
 	}

Somehow this hasn't hit my inbox, good thing I just got the reply and saw the patch. Anyway, thanks!

#243 lore raw

Re: [Bridge] [PATCH 106/141] net: bridge: Fix fall-through warnings for Clang

Quoted 11 lines · Nikolay Aleksandrov
Quoted 10 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/bridge/br_input.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 16 lines

net/bridge/br_input.c int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb · line 154

Quoted 13 lines
net/bridge/br_input.c +1 -0
index 59a318b9f646..8db219d979c5 100644
@@ -148,6 +148,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
 		break;
 	case BR_PKT_UNICAST:
 		dst = br_fdb_find_rcu(br, eth_hdr(skb)->h_dest, vid);
+		break;
 	default:
 		break;
 	}

Somehow this hasn't hit my inbox, good thing I just got the reply and saw the patch. Anyway, thanks!

A lot of e-mails have been bouncing, recently. :/

I think I'll resend all the net patches in this series.

Quoted 1 line

Thanks!
--
Gustavo

#244 lore raw

Re: [PATCH 106/141] net: bridge: Fix fall-through warnings for Clang

In reply to Nikolay Aleksandrov

Hi all,

It's been more than 3 months; who can take this, please? :)

Thanks
--
Gustavo

Quoted 30 lines · Nikolay Aleksandrov
Quoted 16 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/bridge/br_input.c | 1 +
 1 file changed, 1 insertion(+)
net/bridge/br_input.c +0 -0
index 59a318b9f646..8db219d979c5 100644

net/bridge/br_input.c int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb · line 154

Quoted 7 lines
net/bridge/br_input.c +1 -0
@@ -148,6 +148,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
 		break;
 	case BR_PKT_UNICAST:
 		dst = br_fdb_find_rcu(br, eth_hdr(skb)->h_dest, vid);
+		break;
 	default:
 		break;
 	}

Somehow this hasn't hit my inbox, good thing I just got the reply and saw the patch. Anyway, thanks!

#245 lore raw

PATCH 107/141 net: core: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/core/dev.c | 1 +
 1 file changed, 1 insertion(+)
net/core/dev.c +1 -0
index 82dc6b48e45f..9efb03ce504d 100644
@@ -5214,6 +5214,7 @@ static int __netif_receive_skb_core(struct sk_buff **pskb, bool pfmemalloc,
 			goto another_round;
 		case RX_HANDLER_EXACT:
 			deliver_exact = true;
+			break;
 		case RX_HANDLER_PASS:
 			break;
 		default:
Signature · 1 line
2.27.0
#246 lore raw

Re: [PATCH 107/141] net: core: Fix fall-through warnings for Clang

Hi all,

It's been more than 3 months; who can take this, please? :)

Thanks
--
Gustavo

Quoted 25 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/core/dev.c | 1 +
 1 file changed, 1 insertion(+)
net/core/dev.c +1 -0
index 82dc6b48e45f..9efb03ce504d 100644
@@ -5214,6 +5214,7 @@ static int __netif_receive_skb_core(struct sk_buff **pskb, bool pfmemalloc,
 			goto another_round;
 		case RX_HANDLER_EXACT:
 			deliver_exact = true;
+			break;
 		case RX_HANDLER_PASS:
 			break;
 		default:
Signature · 1 line
2.27.0
#247 lore raw

PATCH 108/141 netfilter: ipt_REJECT: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/ipv4/netfilter/ipt_REJECT.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/netfilter/ipt_REJECT.c +1 -0
index e16b98ee6266..7dbb10bbd0f5 100644
@@ -57,6 +57,7 @@ reject_tg(struct sk_buff *skb, const struct xt_action_param *par)
 		break;
 	case IPT_TCP_RESET:
 		nf_send_reset(xt_net(par), skb, hook);
+		break;
 	case IPT_ICMP_ECHOREPLY:
 		/* Doesn't happen. */
 		break;
Signature · 1 line
2.27.0
maintainer Acked-by on v1 108/141
#248 lore raw

Re: [PATCH 108/141] netfilter: ipt_REJECT: Fix fall-through warnings for Clang

Quoted 3 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

#249 lore raw

Re: [PATCH 108/141] netfilter: ipt_REJECT: Fix fall-through warnings for Clang

Quoted 6 lines · Florian Westphal
Quoted 3 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Thanks, Florian.
--
Gustavo

#250 lore raw

PATCH 109/141 net: netrom: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---
 net/netrom/nr_route.c | 4 ++++
 1 file changed, 4 insertions(+)
net/netrom/nr_route.c +4 -0
index 78da5eab252a..de0456073dc0 100644
@@ -266,6 +266,7 @@ static int __must_check nr_add_node(ax25_address *nr, const char *mnemonic,
 		fallthrough;
 	case 2:
 		re_sort_routes(nr_node, 0, 1);
+		break;
 	case 1:
 		break;
 	}
@@ -359,6 +360,7 @@ static int nr_del_node(ax25_address *callsign, ax25_address *neighbour, struct n
 					fallthrough;
 				case 1:
 					nr_node->routes[1] = nr_node->routes[2];
+					fallthrough;
 				case 2:
 					break;
 				}
@@ -482,6 +484,7 @@ static int nr_dec_obs(void)
 					fallthrough;
 				case 1:
 					s->routes[1] = s->routes[2];
+					break;
 				case 2:
 					break;
 				}
@@ -529,6 +532,7 @@ void nr_rt_device_down(struct net_device *dev)
 							fallthrough;
 						case 1:
 							t->routes[1] = t->routes[2];
+							break;
 						case 2:
 							break;
 						}
Signature · 1 line
2.27.0
#251 lore raw

Re: [PATCH 109/141] net: netrom: Fix fall-through warnings for Clang

Quoted 23 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---
 net/netrom/nr_route.c | 4 ++++
 1 file changed, 4 insertions(+)
net/netrom/nr_route.c +1 -0
index 78da5eab252a..de0456073dc0 100644
@@ -266,6 +266,7 @@ static int __must_check nr_add_node(ax25_address *nr, const char *mnemonic,
 		fallthrough;
 	case 2:
 		re_sort_routes(nr_node, 0, 1);
+		break;
 	case 1:
 		break;
 	}

net/netrom/nr_route.c static int nr_del_node(ax25_address *callsign, ax25_address *neighbour, struct n · line 363

Quoted 4 lines
net/netrom/nr_route.c +1 -0
@@ -359,6 +360,7 @@ static int nr_del_node(ax25_address *callsign, ax25_address *neighbour, struct n
 					fallthrough;
 				case 1:
 					nr_node->routes[1] = nr_node->routes[2];
+					fallthrough;

Make this one a break like the others.

Quoted 12 lines
net/netrom/nr_route.c +1 -0
 				case 2:
 					break;
 				}
@@ -482,6 +484,7 @@ static int nr_dec_obs(void)
 					fallthrough;
 				case 1:
 					s->routes[1] = s->routes[2];
+					break;
 				case 2:
 					break;
 				}

net/netrom/nr_route.c void nr_rt_device_down(struct net_device *dev) · line 538

Quoted 7 lines
net/netrom/nr_route.c +1 -0
@@ -529,6 +532,7 @@ void nr_rt_device_down(struct net_device *dev)
 							fallthrough;
 						case 1:
 							t->routes[1] = t->routes[2];
+							break;
 						case 2:
 							break;
 						}

regards,
dan carpenter

#252 lore raw

PATCH 110/141 net/packet: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/packet/af_packet.c | 1 +
 1 file changed, 1 insertion(+)
net/packet/af_packet.c +1 -0
index cefbd50c1090..217d44ab3325 100644
@@ -1649,6 +1649,7 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags)
 	case PACKET_FANOUT_ROLLOVER:
 		if (type_flags & PACKET_FANOUT_FLAG_ROLLOVER)
 			return -EINVAL;
+		break;
 	case PACKET_FANOUT_HASH:
 	case PACKET_FANOUT_LB:
 	case PACKET_FANOUT_CPU:
Signature · 1 line
2.27.0
#253 lore raw

PATCH 111/141 net: plip: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---
 drivers/net/plip/plip.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/plip/plip.c +2 -0
index 4406b353123e..e26cf91bdec2 100644
@@ -516,6 +516,7 @@ plip_receive(unsigned short nibble_timeout, struct net_device *dev,
 		*data_p |= (c0 << 1) & 0xf0;
 		write_data (dev, 0x00); /* send ACK */
 		*ns_p = PLIP_NB_BEGIN;
+		break;
 	case PLIP_NB_2:
 		break;
 	}
@@ -808,6 +809,7 @@ plip_send_packet(struct net_device *dev, struct net_local *nl,
 				return HS_TIMEOUT;
 			}
 		}
+		break;
 
 	case PLIP_PK_LENGTH_LSB:
 		if (plip_send(nibble_timeout, dev,
Signature · 1 line
2.27.0
#254 lore raw

Re: [PATCH 111/141] net: plip: Fix fall-through warnings for Clang

Hi all,

It's been more than 3 months; who can take this, please? :)

Thanks
--
Gustavo

Quoted 33 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---
 drivers/net/plip/plip.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/plip/plip.c +2 -0
index 4406b353123e..e26cf91bdec2 100644
@@ -516,6 +516,7 @@ plip_receive(unsigned short nibble_timeout, struct net_device *dev,
 		*data_p |= (c0 << 1) & 0xf0;
 		write_data (dev, 0x00); /* send ACK */
 		*ns_p = PLIP_NB_BEGIN;
+		break;
 	case PLIP_NB_2:
 		break;
 	}
@@ -808,6 +809,7 @@ plip_send_packet(struct net_device *dev, struct net_local *nl,
 				return HS_TIMEOUT;
 			}
 		}
+		break;
 
 	case PLIP_PK_LENGTH_LSB:
 		if (plip_send(nibble_timeout, dev,
Signature · 1 line
2.27.0
#255 lore raw

PATCH 112/141 net: rose: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---
 net/rose/rose_route.c | 2 ++
 1 file changed, 2 insertions(+)
net/rose/rose_route.c +2 -0
index 6e35703ff353..c0e04c261a15 100644
@@ -347,6 +347,7 @@ static int rose_del_node(struct rose_route_struct *rose_route,
 				case 1:
 					rose_node->neighbour[1] =
 						rose_node->neighbour[2];
+					break;
 				case 2:
 					break;
 				}
@@ -508,6 +509,7 @@ void rose_rt_device_down(struct net_device *dev)
 					fallthrough;
 				case 1:
 					t->neighbour[1] = t->neighbour[2];
+					break;
 				case 2:
 					break;
 				}
Signature · 1 line
2.27.0
#256 lore raw

Re: [PATCH 112/141] net: rose: Fix fall-through warnings for Clang

Hi all,

It's been more than 3 months; who can take this, please? :)

Thanks
--
Gustavo

Quoted 33 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---
 net/rose/rose_route.c | 2 ++
 1 file changed, 2 insertions(+)
net/rose/rose_route.c +2 -0
index 6e35703ff353..c0e04c261a15 100644
@@ -347,6 +347,7 @@ static int rose_del_node(struct rose_route_struct *rose_route,
 				case 1:
 					rose_node->neighbour[1] =
 						rose_node->neighbour[2];
+					break;
 				case 2:
 					break;
 				}
@@ -508,6 +509,7 @@ void rose_rt_device_down(struct net_device *dev)
 					fallthrough;
 				case 1:
 					t->neighbour[1] = t->neighbour[2];
+					break;
 				case 2:
 					break;
 				}
Signature · 1 line
2.27.0
#257 lore raw

PATCH 113/141 nl80211: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/wireless/nl80211.c | 1 +
 1 file changed, 1 insertion(+)
net/wireless/nl80211.c +1 -0
index a77174b99b07..132540a9ac4a 100644
@@ -11165,6 +11165,7 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
 	case NL80211_IFTYPE_P2P_DEVICE:
 		if (!info->attrs[NL80211_ATTR_WIPHY_FREQ])
 			return -EINVAL;
+		break;
 	case NL80211_IFTYPE_STATION:
 	case NL80211_IFTYPE_ADHOC:
 	case NL80211_IFTYPE_P2P_CLIENT:
Signature · 1 line
2.27.0
#258 lore raw

PATCH 114/141 phy: qcom-usb-hs: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/phy/qualcomm/phy-qcom-usb-hs.c | 1 +
 1 file changed, 1 insertion(+)
drivers/phy/qualcomm/phy-qcom-usb-hs.c +1 -0
index 327df1a99f77..5c6c17673396 100644
@@ -56,6 +56,7 @@ static int qcom_usb_hs_phy_set_mode(struct phy *phy,
 			fallthrough;
 		case PHY_MODE_USB_DEVICE:
 			val |= ULPI_INT_SESS_VALID;
+			break;
 		default:
 			break;
 		}
Signature · 1 line
2.27.0
#259 lore raw

PATCH 115/141 rds: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of letting the code fall through to the next case.

---
 net/rds/tcp_connect.c | 1 +
 net/rds/threads.c     | 2 ++
 2 files changed, 3 insertions(+)
net/rds/tcp_connect.c +1 -0
index 4e64598176b0..5461d77fff4f 100644
@@ -78,6 +78,7 @@ void rds_tcp_state_change(struct sock *sk)
 	case TCP_CLOSE_WAIT:
 	case TCP_CLOSE:
 		rds_conn_path_drop(cp, false);
+		break;
 	default:
 		break;
 	}
net/rds/threads.c +2 -0
index 32dc50f0a303..1f424cbfcbb4 100644
@@ -208,6 +208,7 @@ void rds_send_worker(struct work_struct *work)
 		case -ENOMEM:
 			rds_stats_inc(s_send_delayed_retry);
 			queue_delayed_work(rds_wq, &cp->cp_send_w, 2);
+			break;
 		default:
 			break;
 		}
@@ -232,6 +233,7 @@ void rds_recv_worker(struct work_struct *work)
 		case -ENOMEM:
 			rds_stats_inc(s_recv_delayed_retry);
 			queue_delayed_work(rds_wq, &cp->cp_recv_w, 2);
+			break;
 		default:
 			break;
 		}
Signature · 1 line
2.27.0
#260 lore raw

PATCH 116/141 rt2x00: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/net/wireless/ralink/rt2x00/rt2x00queue.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/ralink/rt2x00/rt2x00queue.c +1 -0
index 3b6100e6c8f6..d4d389e8f1b4 100644
@@ -941,6 +941,7 @@ void rt2x00queue_unpause_queue(struct data_queue *queue)
 		 * receive frames.
 		 */
 		queue->rt2x00dev->ops->lib->kick_queue(queue);
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#261 lore raw

PATCH 117/141 rtl8xxxu: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by replacing /* fall through */ comments with the new pseudo-keyword macro fallthrough; instead of letting the code fall through to the next case.

Notice that Clang doesn't recognize /* fall through */ comments as implicit fall-through markings.

---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +4 -4
index 5cd7ef3625c5..afc97958fa4d 100644
@@ -1145,7 +1145,7 @@ void rtl8xxxu_gen1_config_channel(struct ieee80211_hw *hw)
 	switch (hw->conf.chandef.width) {
 	case NL80211_CHAN_WIDTH_20_NOHT:
 		ht = false;
-		/* fall through */
+		fallthrough;
 	case NL80211_CHAN_WIDTH_20:
 		opmode |= BW_OPMODE_20MHZ;
 		rtl8xxxu_write8(priv, REG_BW_OPMODE, opmode);
@@ -1272,7 +1272,7 @@ void rtl8xxxu_gen2_config_channel(struct ieee80211_hw *hw)
 	switch (hw->conf.chandef.width) {
 	case NL80211_CHAN_WIDTH_20_NOHT:
 		ht = false;
-		/* fall through */
+		fallthrough;
 	case NL80211_CHAN_WIDTH_20:
 		rf_mode_bw |= WMAC_TRXPTCL_CTL_BW_20;
 		subchannel = 0;
@@ -1741,11 +1741,11 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
 		case 3:
 			priv->ep_tx_low_queue = 1;
 			priv->ep_tx_count++;
-			/* fall through */
+			fallthrough;
 		case 2:
 			priv->ep_tx_normal_queue = 1;
 			priv->ep_tx_count++;
-			/* fall through */
+			fallthrough;
 		case 1:
 			priv->ep_tx_high_queue = 1;
 			priv->ep_tx_count++;
Signature · 1 line
2.27.0
maintainer NAK
#262 lore raw

Re: [PATCH 117/141] rtl8xxxu: Fix fall-through warnings for Clang

Quoted 5 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by replacing /* fall through */ comments with the new pseudo-keyword macro fallthrough; instead of letting the code fall through to the next case.

Quoted 8 lines

Notice that Clang doesn't recognize /* fall through */ comments as implicit fall-through markings.

---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

While I wasn't CC'ed on the cover-letter I see Jakub also raised issues about this unnecessary patch noise.

Quite frankly, this seems to be patch churn for the sake of patch churn. If clang is broken, fix clang instead.

NACK

Jes

Quoted 37 lines
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +4 -4
index 5cd7ef3625c5..afc97958fa4d 100644
@@ -1145,7 +1145,7 @@ void rtl8xxxu_gen1_config_channel(struct ieee80211_hw *hw)
 	switch (hw->conf.chandef.width) {
 	case NL80211_CHAN_WIDTH_20_NOHT:
 		ht = false;
-		/* fall through */
+		fallthrough;
 	case NL80211_CHAN_WIDTH_20:
 		opmode |= BW_OPMODE_20MHZ;
 		rtl8xxxu_write8(priv, REG_BW_OPMODE, opmode);
@@ -1272,7 +1272,7 @@ void rtl8xxxu_gen2_config_channel(struct ieee80211_hw *hw)
 	switch (hw->conf.chandef.width) {
 	case NL80211_CHAN_WIDTH_20_NOHT:
 		ht = false;
-		/* fall through */
+		fallthrough;
 	case NL80211_CHAN_WIDTH_20:
 		rf_mode_bw |= WMAC_TRXPTCL_CTL_BW_20;
 		subchannel = 0;
@@ -1741,11 +1741,11 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
 		case 3:
 			priv->ep_tx_low_queue = 1;
 			priv->ep_tx_count++;
-			/* fall through */
+			fallthrough;
 		case 2:
 			priv->ep_tx_normal_queue = 1;
 			priv->ep_tx_count++;
-			/* fall through */
+			fallthrough;
 		case 1:
 			priv->ep_tx_high_queue = 1;
 			priv->ep_tx_count++;
#263 lore raw

Re: [PATCH 117/141] rtl8xxxu: Fix fall-through warnings for Clang

Quoted 15 lines · Jes Sorensen
Quoted 5 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by replacing /* fall through */ comments with the new pseudo-keyword macro fallthrough; instead of letting the code fall through to the next case.

Quoted 8 lines

Notice that Clang doesn't recognize /* fall through */ comments as implicit fall-through markings.

---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Quoted 5 lines

While I wasn't CC'ed on the cover-letter I see Jakub also raised issues about this unnecessary patch noise.

Quite frankly, this seems to be patch churn for the sake of patch churn. If clang is broken, fix clang instead.

Just notice that the idea behind this and the following patch is exactly the same:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?id=3f95e92c8a8516b745594049dfccc8c5f8895eea

I could resend this same patch with a different changelog text, but I don't think such a thing is necessary. However, if people prefer that approach, just let me know and I can do it.

Thanks
--
Gustavo

Quoted 38 lines
Quoted 37 lines
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +4 -4
index 5cd7ef3625c5..afc97958fa4d 100644
@@ -1145,7 +1145,7 @@ void rtl8xxxu_gen1_config_channel(struct ieee80211_hw *hw)
 	switch (hw->conf.chandef.width) {
 	case NL80211_CHAN_WIDTH_20_NOHT:
 		ht = false;
-		/* fall through */
+		fallthrough;
 	case NL80211_CHAN_WIDTH_20:
 		opmode |= BW_OPMODE_20MHZ;
 		rtl8xxxu_write8(priv, REG_BW_OPMODE, opmode);
@@ -1272,7 +1272,7 @@ void rtl8xxxu_gen2_config_channel(struct ieee80211_hw *hw)
 	switch (hw->conf.chandef.width) {
 	case NL80211_CHAN_WIDTH_20_NOHT:
 		ht = false;
-		/* fall through */
+		fallthrough;
 	case NL80211_CHAN_WIDTH_20:
 		rf_mode_bw |= WMAC_TRXPTCL_CTL_BW_20;
 		subchannel = 0;
@@ -1741,11 +1741,11 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
 		case 3:
 			priv->ep_tx_low_queue = 1;
 			priv->ep_tx_count++;
-			/* fall through */
+			fallthrough;
 		case 2:
 			priv->ep_tx_normal_queue = 1;
 			priv->ep_tx_count++;
-			/* fall through */
+			fallthrough;
 		case 1:
 			priv->ep_tx_high_queue = 1;
 			priv->ep_tx_count++;
#264 lore raw

PATCH 118/141 rtw88: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by replacing a /* fall through */ comment with the new pseudo-keyword macro fallthrough; instead of letting the code fall through to the next case.

Notice that Clang doesn't recognize /* fall through */ comments as implicit fall-through markings.

---
 drivers/net/wireless/realtek/rtw88/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/fw.c +1 -1
index 042015bc8055..e2d4bb180afd 100644
@@ -1473,7 +1473,7 @@ static bool rtw_fw_dump_check_size(struct rtw_dev *rtwdev,
 	case RTW_FW_FIFO_SEL_RX:
 		if ((start_addr + size) > rtwdev->chip->fw_fifo_addr[sel])
 			return false;
-		/*fall through*/
+		fallthrough;
 	default:
 		return true;
 	}
Signature · 1 line
2.27.0
#265 lore raw

PATCH 119/141 rxrpc: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 net/rxrpc/af_rxrpc.c | 1 +
 1 file changed, 1 insertion(+)
net/rxrpc/af_rxrpc.c +1 -0
index 0a2f4817ec6c..aa43191dbb09 100644
@@ -471,6 +471,7 @@ static int rxrpc_connect(struct socket *sock, struct sockaddr *addr,
 	switch (rx->sk.sk_state) {
 	case RXRPC_UNBOUND:
 		rx->sk.sk_state = RXRPC_CLIENT_UNBOUND;
+		break;
 	case RXRPC_CLIENT_UNBOUND:
 	case RXRPC_CLIENT_BOUND:
 		break;
Signature · 1 line
2.27.0
#266 lore raw

PATCH 120/141 scsi: aacraid: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/scsi/aacraid/commsup.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/aacraid/commsup.c +1 -0
index b99ca1b0c553..0ae0d1fa2b50 100644
@@ -1448,6 +1448,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
 				break;
 			}
 			scsi_rescan_device(&device->sdev_gendev);
+			break;
 
 		default:
 			break;
Signature · 1 line
2.27.0
#267 lore raw

PATCH 121/141 scsi: aha1740: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/scsi/aha1740.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/aha1740.c +1 -0
index 5a227c03895f..0dc831026e9e 100644
@@ -152,6 +152,7 @@ static int aha1740_makecode(unchar *sense, unchar *status)
 					retval=DID_ERROR; /* It's an Overrun */
 				/* If not overrun, assume underrun and
 				 * ignore it! */
+				break;
 			case 0x00: /* No info, assume no error, should
 				    * not occur */
 				break;
Signature · 1 line
2.27.0
#268 lore raw

PATCH 122/141 scsi: csiostor: Fix fall-through warnings for Clang

In reply to Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
 drivers/scsi/csiostor/csio_wr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/csiostor/csio_wr.c +1 -0
index 9010cb6045dc..fe0355c964bc 100644
@@ -830,6 +830,7 @@ csio_wr_destroy_queues(struct csio_hw *hw, bool cmd)
 				if (flq_idx != -1)
 					csio_q_flid(hw, flq_idx) = CSIO_MAX_QID;
 			}
+			break;
 		default:
 			break;
 		}
Signature · 1 line
2.27.0