]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ice: fix clang warning regarding deadcode.DeadStores
authorPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Wed, 31 Mar 2021 21:17:06 +0000 (14:17 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 7 Jun 2021 15:59:02 +0000 (08:59 -0700)
clang generates deadcode.DeadStores warnings when a variable
is used to read a value, but then that value isn't used later
in the code. Fix this warning.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_ethtool.c

index d9ddd0bcf65f80c38e47056457e4d87fdb1320d8..f60bf2f5af130d2e49431dbb0a3e89bd37016d6f 100644 (file)
@@ -3501,13 +3501,9 @@ static int
 ice_get_rc_coalesce(struct ethtool_coalesce *ec, enum ice_container_type c_type,
                    struct ice_ring_container *rc)
 {
-       struct ice_pf *pf;
-
        if (!rc->ring)
                return -EINVAL;
 
-       pf = rc->ring->vsi->back;
-
        switch (c_type) {
        case ICE_RX_CONTAINER:
                ec->use_adaptive_rx_coalesce = ITR_IS_DYNAMIC(rc);
@@ -3519,7 +3515,7 @@ ice_get_rc_coalesce(struct ethtool_coalesce *ec, enum ice_container_type c_type,
                ec->tx_coalesce_usecs = rc->itr_setting;
                break;
        default:
-               dev_dbg(ice_pf_to_dev(pf), "Invalid c_type %d\n", c_type);
+               dev_dbg(ice_pf_to_dev(rc->ring->vsi->back), "Invalid c_type %d\n", c_type);
                return -EINVAL;
        }