net/ice/base: avoid undefined behavior
authorQi Zhang <qi.z.zhang@intel.com>
Mon, 15 Jun 2020 02:04:26 +0000 (10:04 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jun 2020 17:21:07 +0000 (19:21 +0200)
commit135ccbc6a753c8306d3807abc9de3ed8989e8db2
tree6c42835067b48f3a84220a117870ae391530fdd6
parentfba97b34e5e88020bcbf1623175a43b87fd204ac
net/ice/base: 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: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
drivers/net/ice/base/ice_common.c
drivers/net/ice/base/ice_common.h
drivers/net/ice/base/ice_lan_tx_rx.h
drivers/net/ice/ice_rxtx.c