diff options
| author | Jesse Brandeburg <[email protected]> | 2023-12-06 01:01:14 +0000 |
|---|---|---|
| committer | Tony Nguyen <[email protected]> | 2023-12-18 19:20:43 +0000 |
| commit | 6aa7ca3c7dcc5effc4963d18b300fc942e738a3b (patch) | |
| tree | 9c4213e5b3cf3e5428cf77f3427ecc67ff262384 /drivers/net/ethernet/intel/ice/ice_txrx.c | |
| parent | ice: cleanup inconsistent code (diff) | |
| download | kernel-6aa7ca3c7dcc5effc4963d18b300fc942e738a3b.tar.gz kernel-6aa7ca3c7dcc5effc4963d18b300fc942e738a3b.zip | |
idpf: refactor some missing field get/prep conversions
Most of idpf correctly uses FIELD_GET and FIELD_PREP, but a couple spots
were missed so fix those.
Automated conversion with coccinelle script and manually fixed up,
including audits for opportunities to convert to {get,encode,replace}
bits functions.
Add conversions to le16_get/encode/replace_bits where appropriate. And
in one place fix up a cast from a u16 to a u16.
@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)
@get@
constant shift,mask;
type T;
expression a;
@@
-((T)((a) & mask) >> shift)
+FIELD_GET(mask, a)
and applied via:
spatch --sp-file field_prep.cocci --in-place --dir \
drivers/net/ethernet/intel/
CC: Alexander Lobakin <[email protected]>
Reviewed-by: Przemek Kitszel <[email protected]>
Signed-off-by: Jesse Brandeburg <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_txrx.c')
0 files changed, 0 insertions, 0 deletions
