]> git.ipfire.org Git - thirdparty/linux.git/commit
ice: fix AQ error code comparison in ice_set_pauseparam()
authorLukasz Czapnik <lukasz.czapnik@intel.com>
Fri, 27 Mar 2026 07:22:35 +0000 (08:22 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 22 Jun 2026 21:04:01 +0000 (14:04 -0700)
commit2bf7744bc3221a63b95c76c94eab1dad832fa401
treed14f10adec7c0504ee1e3998046a1ad46f1c23f8
parentebbe8868cf473f698e0fbaf436d2618b2bcda806
ice: fix AQ error code comparison in ice_set_pauseparam()

Fix unreachable code: the conditionals in ice_set_pauseparam() used
the bitwise-AND operator suggesting aq_failures is a bitmap, but it
is actually an enum, making the third condition logically unreachable.

Replace the if-else ladder with a switch statement.  Also move the
aq_failures initialization to the variable declaration and remove the
redundant zeroing from ice_set_fc().

Fixes: fcea6f3da546 ("ice: Add stats and ethtool support")
Signed-off-by: Lukasz Czapnik <lukasz.czapnik@intel.com>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_common.c
drivers/net/ethernet/intel/ice/ice_ethtool.c