linux/drivers/net/ethernet/intel/ice
Jesse Brandeburg 23eca34e55 ice: field prep conversion
Refactor ice driver to use FIELD_PREP(), which reduces lines of code
and adds clarity of intent.

This code was generated by the following coccinelle/spatch script and
then manually repaired.

Several places I changed to OR into a single variable with |= instead of
using a multi-line statement with trailing OR operators, as it
(subjectively) makes the code clearer.

A local variable vmvf_and_timeout was created and used to avoid multiple
logical ORs being __le16 converted, which shortened some lines and makes
the code cleaner.

Also clean up a couple of places where conversions were made to have the
code read more clearly/consistently.

@prep2@
constant shift,mask;
type T;
expression a;
@@
-(((T)(a) << shift) & mask)
+FIELD_PREP(mask, a)

@prep@
constant shift,mask;
type T;
expression a;
@@
-((T)((a) << shift) & mask)
+FIELD_PREP(mask, a)

Cc: Julia Lawall <Julia.Lawall@inria.fr>
CC: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2023-12-18 11:20:26 -08:00
..
ice.h ice: configure FW logging 2023-12-14 09:50:48 -08:00
ice_adminq_cmd.h ice: add ability to read and configure FW log data 2023-12-14 09:50:58 -08:00
ice_arfs.c
ice_arfs.h
ice_base.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_base.h
ice_cgu_regs.h
ice_common.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_common.h ice: remove FW logging code 2023-12-14 09:43:04 -08:00
ice_controlq.c
ice_controlq.h
ice_dcb.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_dcb.h
ice_dcb_lib.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_dcb_lib.h
ice_dcb_nl.c
ice_dcb_nl.h
ice_ddp.c
ice_ddp.h
ice_debugfs.c ice: add ability to read and configure FW log data 2023-12-14 09:50:58 -08:00
ice_devids.h
ice_devlink.c ice: add CGU info to devlink info callback 2023-12-05 11:40:12 +01:00
ice_devlink.h ice: set Tx topology every time new repr is added 2023-11-13 11:42:14 -08:00
ice_dpll.c dpll: remove leftover mode_supported() op and use mode_get() instead 2023-12-13 10:31:19 +00:00
ice_dpll.h
ice_eswitch.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_eswitch.h ice: reserve number of CP queues 2023-11-13 11:42:15 -08:00
ice_eswitch_br.c ice: make representor code generic 2023-11-13 11:42:14 -08:00
ice_eswitch_br.h
ice_ethtool.c ice: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_ethtool.h
ice_ethtool_fdir.c ice: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_fdir.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_fdir.h
ice_flex_pipe.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_flex_pipe.h ice: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_flex_type.h ice: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_flow.c ice: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_flow.h ice: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_fltr.c
ice_fltr.h
ice_fw_update.c
ice_fw_update.h
ice_fwlog.c ice: add ability to read and configure FW log data 2023-12-14 09:50:58 -08:00
ice_fwlog.h ice: add ability to read and configure FW log data 2023-12-14 09:50:58 -08:00
ice_gnss.c
ice_gnss.h
ice_hw_autogen.h ice: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_hwmon.c ice: read internal temperature sensor 2023-12-05 11:40:12 +01:00
ice_hwmon.h ice: read internal temperature sensor 2023-12-05 11:40:12 +01:00
ice_idc.c
ice_idc_int.h
ice_irq.c
ice_irq.h
ice_lag.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_lag.h ice: Fix VF Reset paths when interface in a failed over aggregate 2023-11-29 19:55:49 -08:00
ice_lan_tx_rx.h
ice_lib.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_lib.h ice: Add support in the driver for associating queue with napi 2023-12-04 18:04:05 -08:00
ice_main.c ice: add ability to read and configure FW log data 2023-12-14 09:50:58 -08:00
ice_nvm.c
ice_nvm.h
ice_osdep.h
ice_pf_vsi_vlan_ops.c
ice_pf_vsi_vlan_ops.h
ice_protocol_type.h
ice_ptp.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_ptp.h ice: Rename E822 to E82X 2023-12-05 11:40:12 +01:00
ice_ptp_consts.h ice: Rename E822 to E82X 2023-12-05 11:40:12 +01:00
ice_ptp_hw.c ice: Rename E822 to E82X 2023-12-05 11:40:12 +01:00
ice_ptp_hw.h ice: Rename E822 to E82X 2023-12-05 11:40:12 +01:00
ice_repr.c ice: add VF representors one by one 2023-11-13 11:42:14 -08:00
ice_repr.h ice: add VF representors one by one 2023-11-13 11:42:14 -08:00
ice_sbq_cmd.h
ice_sched.c
ice_sched.h
ice_sriov.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_sriov.h
ice_switch.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_switch.h
ice_tc_lib.c
ice_tc_lib.h
ice_trace.h
ice_txrx.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_txrx.h ice: remove ptp_tx ring parameter flag 2023-11-23 15:27:32 +01:00
ice_txrx_lib.c
ice_txrx_lib.h
ice_type.h ice: add ability to read and configure FW log data 2023-12-14 09:50:58 -08:00
ice_vf_lib.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-11-30 16:11:19 -08:00
ice_vf_lib.h ice: make representor code generic 2023-11-13 11:42:14 -08:00
ice_vf_lib_private.h
ice_vf_mbx.c
ice_vf_mbx.h
ice_vf_vsi_vlan_ops.c ice: Restore fix disabling RX VLAN filtering 2023-12-05 10:51:22 -08:00
ice_vf_vsi_vlan_ops.h
ice_virtchnl.c iavf: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_virtchnl.h iavf: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_virtchnl_allowlist.c iavf: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_virtchnl_allowlist.h
ice_virtchnl_fdir.c ice: enable symmetric-xor RSS for Toeplitz hash function 2023-12-13 22:07:17 -08:00
ice_virtchnl_fdir.h
ice_vlan.h
ice_vlan_mode.c
ice_vlan_mode.h
ice_vsi_vlan_lib.c ice: field prep conversion 2023-12-18 11:20:26 -08:00
ice_vsi_vlan_lib.h
ice_vsi_vlan_ops.c
ice_vsi_vlan_ops.h
ice_xsk.c
ice_xsk.h
Makefile ice: configure FW logging 2023-12-14 09:50:48 -08:00