diff options
author | Jesse Brandeburg <[email protected]> | 2023-12-05 17:01:04 -0800 |
---|---|---|
committer | Tony Nguyen <[email protected]> | 2023-12-18 11:16:15 -0800 |
commit | 9b7f18042d4c12ecc5fc797c0a31b0ff0bcef3cc (patch) | |
tree | 4b8f79df0e96471e0588f17dd6e62acf56d6ef90 /tools/perf/scripts/python/futex-contention.py | |
parent | 9e3ab72c049929afccea62a08dbaeaeee8e06c46 (diff) |
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 <[email protected]>
Cc: Ahmed Zaki <[email protected]>
Reviewed-by: Marcin Szycik <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Signed-off-by: Jesse Brandeburg <[email protected]>
Tested-by: Rafal Romanowski <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/futex-contention.py')
0 files changed, 0 insertions, 0 deletions