linux/drivers/net/ethernet/intel
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
..
e1000 intel: add bit macro includes where needed 2023-12-18 11:15:43 -08:00
e1000e intel: legacy: field prep conversion 2023-12-18 11:15:53 -08:00
fm10k intel: legacy: field prep conversion 2023-12-18 11:15:53 -08:00
i40e i40e: field prep conversion 2023-12-18 11:16:03 -08:00
iavf iavf: field prep conversion 2023-12-18 11:16:15 -08:00
ice ice: field prep conversion 2023-12-18 11:20:26 -08:00
idpf net: ethtool: pass a pointer to parameters to get/set_rxfh ethtool ops 2023-12-13 22:07:16 -08:00
igb intel: legacy: field prep conversion 2023-12-18 11:15:53 -08:00
igbvf intel: add bit macro includes where needed 2023-12-18 11:15:43 -08:00
igc intel: add bit macro includes where needed 2023-12-18 11:15:43 -08:00
ixgbe intel: legacy: field prep conversion 2023-12-18 11:15:53 -08:00
ixgbevf net: ethtool: pass a pointer to parameters to get/set_rxfh ethtool ops 2023-12-13 22:07:16 -08:00
e100.c e100: replace deprecated strncpy with strscpy 2023-10-18 18:10:17 -07:00
Kconfig ice: read internal temperature sensor 2023-12-05 11:40:12 +01:00
Makefile idpf: add SRIOV support and other ndo_ops 2023-09-13 14:59:24 -07:00