aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_common.h
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2020-05-15 17:42:18 -0700
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2020-05-27 17:58:21 -0700
commit7e34786a74e14038faadabb24b0d7f4436961c6b (patch)
treed63c3f017681e6231cf183453499e23ff3b8e227 /drivers/net/ethernet/intel/ice/ice_common.h
parentice: Change number of XDP Tx queues to match number of Rx queues (diff)
downloadlinux-dev-7e34786a74e14038faadabb24b0d7f4436961c6b.tar.xz
linux-dev-7e34786a74e14038faadabb24b0d7f4436961c6b.zip
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>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_common.h')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_common.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_common.h b/drivers/net/ethernet/intel/ice/ice_common.h
index bea755a658eb..9b9e50d2398b 100644
--- a/drivers/net/ethernet/intel/ice/ice_common.h
+++ b/drivers/net/ethernet/intel/ice/ice_common.h
@@ -70,7 +70,8 @@ enum ice_status ice_aq_q_shutdown(struct ice_hw *hw, bool unloading);
void ice_fill_dflt_direct_cmd_desc(struct ice_aq_desc *desc, u16 opcode);
extern const struct ice_ctx_ele ice_tlan_ctx_info[];
enum ice_status
-ice_set_ctx(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info);
+ice_set_ctx(struct ice_hw *hw, u8 *src_ctx, u8 *dest_ctx,
+ const struct ice_ctx_ele *ce_info);
extern struct mutex ice_global_cfg_lock_sw;