]> git.baikalelectronics.ru Git - kernel.git/commit
ice: avoid undefined behavior
authorBruce Allan <bruce.w.allan@intel.com>
Sat, 16 May 2020 00:42:18 +0000 (17:42 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 28 May 2020 00:58:21 +0000 (17:58 -0700)
commit0447e049eb312f997ca214cf44ad8faf4eec2223
treed63c3f017681e6231cf183453499e23ff3b8e227
parentdc62ecf124f01cef555c931b0945f906e9acca7e
ice: avoid undefined behavior

When writing the driver's struct ice_tlan_ctx structure, do not write the
8-bit element int_q_state with the associated internal-to-hardware field
which is 122-bits, otherwise the helper function ice_write_byte() will use
undefined behavior when setting the mask used for that write.  This should
not cause any functional change and will avoid use of undefined behavior.
Also, update a comment to highlight this structure element is not written.

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_base.c
drivers/net/ethernet/intel/ice/ice_common.c
drivers/net/ethernet/intel/ice/ice_common.h
drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h