diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2023-12-05 17:01:04 -0800 |
---|---|---|
committer | Tony Nguyen <anthony.l.nguyen@intel.com> | 2023-12-18 11:16:15 -0800 |
commit | 9b7f18042d4c12ecc5fc797c0a31b0ff0bcef3cc (patch) | |
tree | 4b8f79df0e96471e0588f17dd6e62acf56d6ef90 /drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | |
parent | 9e3ab72c049929afccea62a08dbaeaeee8e06c46 (diff) | |
download | linux-9b7f18042d4c12ecc5fc797c0a31b0ff0bcef3cc.tar.gz linux-9b7f18042d4c12ecc5fc797c0a31b0ff0bcef3cc.tar.bz2 linux-9b7f18042d4c12ecc5fc797c0a31b0ff0bcef3cc.zip |
iavf: field prep conversion
Refactor iavf 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.
Clean up a couple spots in the code that had repetitive
y = cpu_to_*((blah << blah_blah) & blat)
y |= cpu_to_*((blahs << blahs_blahs) & blats)
to
x = FIELD_PREP(blat blah)
x |= FIELD_PREP(blats, blahs)
y = cpu_to_*(x);
@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: Ahmed Zaki <ahmed.zaki@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: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_adminq_cmd.h')
0 files changed, 0 insertions, 0 deletions