ice: specify field names in ice_prot_ext init
authorMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Fri, 7 Apr 2023 16:52:17 +0000 (18:52 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 19 May 2023 16:08:55 +0000 (09:08 -0700)
Anonymous initializers are now discouraged. Define ICE_PROTCOL_ENTRY
macro to rewrite anonymous initializers to named one. No functional
changes here.

Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_switch.c

index e806dfe69b900586053af21ae58d1b593ae675e3..baa61a2b82f06e1134b9b39375ea2b0eaef2fc2a 100644 (file)
@@ -4540,6 +4540,11 @@ ice_free_res_cntr(struct ice_hw *hw, u8 type, u8 alloc_shared, u16 num_items,
        return status;
 }
 
+#define ICE_PROTOCOL_ENTRY(id, ...) {          \
+       .prot_type      = id,                   \
+       .offs           = {__VA_ARGS__},        \
+}
+
 /* This is mapping table entry that maps every word within a given protocol
  * structure to the real byte offset as per the specification of that
  * protocol header.
@@ -4550,29 +4555,29 @@ ice_free_res_cntr(struct ice_hw *hw, u8 type, u8 alloc_shared, u16 num_items,
  * structure is added to that union.
  */
 static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = {
-       { ICE_MAC_OFOS,         { 0, 2, 4, 6, 8, 10, 12 } },
-       { ICE_MAC_IL,           { 0, 2, 4, 6, 8, 10, 12 } },
-       { ICE_ETYPE_OL,         { 0 } },
-       { ICE_ETYPE_IL,         { 0 } },
-       { ICE_VLAN_OFOS,        { 2, 0 } },
-       { ICE_IPV4_OFOS,        { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 } },
-       { ICE_IPV4_IL,          { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 } },
-       { ICE_IPV6_OFOS,        { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24,
-                                26, 28, 30, 32, 34, 36, 38 } },
-       { ICE_IPV6_IL,          { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24,
-                                26, 28, 30, 32, 34, 36, 38 } },
-       { ICE_TCP_IL,           { 0, 2 } },
-       { ICE_UDP_OF,           { 0, 2 } },
-       { ICE_UDP_ILOS,         { 0, 2 } },
-       { ICE_VXLAN,            { 8, 10, 12, 14 } },
-       { ICE_GENEVE,           { 8, 10, 12, 14 } },
-       { ICE_NVGRE,            { 0, 2, 4, 6 } },
-       { ICE_GTP,              { 8, 10, 12, 14, 16, 18, 20, 22 } },
-       { ICE_GTP_NO_PAY,       { 8, 10, 12, 14 } },
-       { ICE_PPPOE,            { 0, 2, 4, 6 } },
-       { ICE_L2TPV3,           { 0, 2, 4, 6, 8, 10 } },
-       { ICE_VLAN_EX,          { 2, 0 } },
-       { ICE_VLAN_IN,          { 2, 0 } },
+       ICE_PROTOCOL_ENTRY(ICE_MAC_OFOS, 0, 2, 4, 6, 8, 10, 12),
+       ICE_PROTOCOL_ENTRY(ICE_MAC_IL, 0, 2, 4, 6, 8, 10, 12),
+       ICE_PROTOCOL_ENTRY(ICE_ETYPE_OL, 0),
+       ICE_PROTOCOL_ENTRY(ICE_ETYPE_IL, 0),
+       ICE_PROTOCOL_ENTRY(ICE_VLAN_OFOS, 2, 0),
+       ICE_PROTOCOL_ENTRY(ICE_IPV4_OFOS, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18),
+       ICE_PROTOCOL_ENTRY(ICE_IPV4_IL, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18),
+       ICE_PROTOCOL_ENTRY(ICE_IPV6_OFOS, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18,
+                          20, 22, 24, 26, 28, 30, 32, 34, 36, 38),
+       ICE_PROTOCOL_ENTRY(ICE_IPV6_IL, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20,
+                          22, 24, 26, 28, 30, 32, 34, 36, 38),
+       ICE_PROTOCOL_ENTRY(ICE_TCP_IL, 0, 2),
+       ICE_PROTOCOL_ENTRY(ICE_UDP_OF, 0, 2),
+       ICE_PROTOCOL_ENTRY(ICE_UDP_ILOS, 0, 2),
+       ICE_PROTOCOL_ENTRY(ICE_VXLAN, 8, 10, 12, 14),
+       ICE_PROTOCOL_ENTRY(ICE_GENEVE, 8, 10, 12, 14),
+       ICE_PROTOCOL_ENTRY(ICE_NVGRE, 0, 2, 4, 6),
+       ICE_PROTOCOL_ENTRY(ICE_GTP, 8, 10, 12, 14, 16, 18, 20, 22),
+       ICE_PROTOCOL_ENTRY(ICE_GTP_NO_PAY, 8, 10, 12, 14),
+       ICE_PROTOCOL_ENTRY(ICE_PPPOE, 0, 2, 4, 6),
+       ICE_PROTOCOL_ENTRY(ICE_L2TPV3, 0, 2, 4, 6, 8, 10),
+       ICE_PROTOCOL_ENTRY(ICE_VLAN_EX, 2, 0),
+       ICE_PROTOCOL_ENTRY(ICE_VLAN_IN, 2, 0),
 };
 
 static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = {