ice: replace "fallthrough" comments with fallthrough reserved word
authorBruce Allan <bruce.w.allan@intel.com>
Wed, 22 Jan 2020 15:21:35 +0000 (07:21 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sun, 16 Feb 2020 01:03:12 +0000 (17:03 -0800)
"fallthrough" comments are used in switch case statements to explicitly
indicate the code is intended to fall through to the following statement.
Different variants of "fallthough" are acceptable, e.g. "fall through",
"fallthrough", "Fall-through".  The GCC compiler has an optional warning
(-Wimplicit-fallthrough[=n]) to warn when such a comment is not present;
the default version of which is enabled when compiling the Linux kernel.

There have been recent discussions in kernel mailing lists regarding
replacing non-standardized "fallthrough" comments with the pseudo-reserved
word 'fallthrough' which will be defined as __attribute__ ((fallthrough))
for versions of gcc that support it (i.e. gcc 7 and newer) or as a nop
for versions that do not.  Replace "fallthrough" comments with fallthrough
reserved word.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_common.c
drivers/net/ethernet/intel/ice/ice_main.c
drivers/net/ethernet/intel/ice/ice_switch.c
drivers/net/ethernet/intel/ice/ice_txrx.c
drivers/net/ethernet/intel/ice/ice_xsk.c

index 04d5db0a25bfb521cabc435fcd489e1d8fce4d33..5587e9eb4cd0c1358316ad5b960ad2784e2a8480 100644 (file)
@@ -1181,7 +1181,7 @@ ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf,
        case ice_aqc_opc_release_res:
                if (le16_to_cpu(cmd->res_id) == ICE_AQC_RES_ID_GLBL_LOCK)
                        break;
-               /* fall-through */
+               fallthrough;
        default:
                mutex_lock(&ice_global_cfg_lock_sw);
                lock_acquired = true;
@@ -2703,7 +2703,7 @@ __ice_aq_get_set_rss_lut(struct ice_hw *hw, u16 vsi_id, u8 lut_type, u8 *lut,
                                 ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M;
                        break;
                }
-               /* fall-through */
+               fallthrough;
        default:
                status = ICE_ERR_PARAM;
                goto ice_aq_get_set_rss_lut_exit;
index ce5397d182198155b9b79b933c1e3b037e162cd8..160328cd0d7eacff4d2a82933f10ecb0026a21ee 100644 (file)
@@ -2985,7 +2985,7 @@ ice_log_pkg_init(struct ice_hw *hw, enum ice_status *status)
                default:
                        break;
                }
-               /* fall-through */
+               fallthrough;
        default:
                dev_err(dev, "An unknown error (%d) occurred when loading the DDP package.  Entering Safe Mode.\n",
                        *status);
index 431266081a80a086ba8b235a8c3c2c4bb03f850b..4d96abfd05d6cb3d974006bc9c904c020d8a2b33 100644 (file)
@@ -760,7 +760,7 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info,
                break;
        case ICE_SW_LKUP_ETHERTYPE_MAC:
                daddr = f_info->l_data.ethertype_mac.mac_addr;
-               /* fall-through */
+               fallthrough;
        case ICE_SW_LKUP_ETHERTYPE:
                off = (__force __be16 *)(eth_hdr + ICE_ETH_ETHTYPE_OFFSET);
                *off = cpu_to_be16(f_info->l_data.ethertype_mac.ethertype);
@@ -771,7 +771,7 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info,
                break;
        case ICE_SW_LKUP_PROMISC_VLAN:
                vlan_id = f_info->l_data.mac_vlan.vlan_id;
-               /* fall-through */
+               fallthrough;
        case ICE_SW_LKUP_PROMISC:
                daddr = f_info->l_data.mac_vlan.mac_addr;
                break;
index 0c08ab0462df0a9c6b261ec8ebfd3dca833a4ee4..f67e8362958ca2fc1be7bae240df165269848a6f 100644 (file)
@@ -453,10 +453,10 @@ ice_run_xdp(struct ice_ring *rx_ring, struct xdp_buff *xdp,
                break;
        default:
                bpf_warn_invalid_xdp_action(act);
-               /* fallthrough -- not supported action */
+               fallthrough;
        case XDP_ABORTED:
                trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
-               /* fallthrough -- handle aborts by dropping frame */
+               fallthrough;
        case XDP_DROP:
                result = ICE_XDP_CONSUMED;
                break;
index fd96301e59bb1a7acca9a84efa71638e60226653..4adb8a3ba06e7b0e74b7712e8efb0647497e029b 100644 (file)
@@ -816,10 +816,10 @@ ice_run_xdp_zc(struct ice_ring *rx_ring, struct xdp_buff *xdp)
                break;
        default:
                bpf_warn_invalid_xdp_action(act);
-               /* fallthrough -- not supported action */
+               fallthrough;
        case XDP_ABORTED:
                trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
-               /* fallthrough -- handle aborts by dropping frame */
+               fallthrough;
        case XDP_DROP:
                result = ICE_XDP_CONSUMED;
                break;