ice: refactor to remove not needed packing
Subsystems (2)
PATCH 1/1 ice: refactor to remove not needed packing
After the changes to the structures to make them flex array safe, packing is no longer necessary.
to reproduce:
make EXTRA_CFLAGS=-Wpacked drivers/net/ethernet/intel/ice/ice.ko
In file included from drivers/net/ethernet/intel/ice/ice_controlq.h:7,
from drivers/net/ethernet/intel/ice/ice_type.h:14,
from drivers/net/ethernet/intel/ice/ice.h:59:drivers/net/ethernet/intel/ice/ice_adminq_cmd.h:618:1: warning: packed attribute is unnecessary for ‘ice_aqc_sw_rules_elem_hdr’ [-Wpacked]
618 | } __packed __aligned(sizeof(__le16));
| ^
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h:705:1: warning: packed attribute is unnecessary for ‘ice_sw_rule_lkup_rx_tx’ [-Wpacked]
705 | } __packed __aligned(sizeof(__le16));
| ^
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h:767:1: warning: packed attribute is unnecessary for ‘ice_sw_rule_lg_act’ [-Wpacked]
767 | } __packed __aligned(sizeof(__le16));
| ^
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h:779:1: warning: packed attribute is unnecessary for ‘ice_sw_rule_vsi_list’ [-Wpacked]
779 | } __packed __aligned(sizeof(__le16));
| ^--- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +4 -4
@@ -615,7 +615,7 @@ struct ice_aqc_sw_rules_elem_hdr {#define ICE_AQC_SW_RULES_T_PRUNE_LIST_SET 0x5#define ICE_AQC_SW_RULES_T_PRUNE_LIST_CLEAR 0x6__le16 status; -} __packed__aligned(sizeof(__le16)) ; +}__aligned(sizeof(__le16)) ;/* Add/Update/Get/Remove lookup Rx/Tx command/response entry * This structures describes the lookup rules and associated actions. "index"
@@ -702,7 +702,7 @@ struct ice_sw_rule_lkup_rx_tx {*/ __le16 hdr_len;u8 hdr_data[]; -} __packed__aligned(sizeof(__le16)) ; +}__aligned(sizeof(__le16)) ;/* Add/Update/Remove large action command/response entry * "index" is returned as part of a response to a successful Add command, and
@@ -764,7 +764,7 @@ struct ice_sw_rule_lg_act {#define ICE_LG_ACT_STAT_COUNT_S 3#define ICE_LG_ACT_STAT_COUNT_M (0x7F << ICE_LG_ACT_STAT_COUNT_S)__le32 act[];/* array of size for actions */ -} __packed__aligned(sizeof(__le16)) ; +}__aligned(sizeof(__le16)) ;/* Add/Update/Remove VSI list command/response entry * "index" is returned as part of a response to a successful Add command, and
@@ -776,7 +776,7 @@ struct ice_sw_rule_vsi_list {__le16 index;/* Index of VSI/Prune list */ __le16 number_vsi;__le16 vsi[];/* Array of number_vsi VSI numbers */ -} __packed__aligned(sizeof(__le16)) ; +}__aligned(sizeof(__le16)) ;/* Query PFC Mode (direct 0x0302) * Set PFC Mode (direct 0x0303)
Signature · 6 lines
2.39.2 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 22 lines · Jesse Brandeburg
After the changes to the structures to make them flex array safe, packing is no longer necessary.
to reproduce:
make EXTRA_CFLAGS=-Wpackeddrivers/net/ethernet/intel/ice/ice.koIn file included from
drivers/net/ethernet/intel/ice/ice_controlq.h:7,
fromdrivers/net/ethernet/intel/ice/ice_type.h:14,
fromdrivers/net/ethernet/intel/ice/ice.h:59:drivers/net/ethernet/intel/ice/ice_adminq_cmd.h:618:1: warning: packed attribute is unnecessary for ‘ice_aqc_sw_rules_elem_hdr’ [-Wpacked]618 | } __packed __aligned(sizeof(__le16)); | ^ drivers/net/ethernet/intel/ice/ice_adminq_cmd.h:705:1: warning: packed attribute is unnecessary for ‘ice_sw_rule_lkup_rx_tx’ [-Wpacked] 705 | } __packed __aligned(sizeof(__le16)); | ^ drivers/net/ethernet/intel/ice/ice_adminq_cmd.h:767:1: warning: packed attribute is unnecessary for ‘ice_sw_rule_lg_act’ [-Wpacked] 767 | } __packed __aligned(sizeof(__le16)); | ^ drivers/net/ethernet/intel/ice/ice_adminq_cmd.h:779:1: warning: packed attribute is unnecessary for ‘ice_sw_rule_vsi_list’ [-Wpacked] 779 | } __packed __aligned(sizeof(__le16)); | ^
Quoted 2 lines
Fixes 6e1ff618737a ("ice: fix access-beyond-end in the switch code")Signed-off-by Jesse Brandeburg <[email protected]>
please ignore this one, I sent it to the wrong base tree (next instead of net)
see v2...
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan