> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf Of Jesse 
> Brandeburg
> Sent: Wednesday, December 6, 2023 6:31 AM
> To: [email protected]
> Cc: Kitszel, Przemyslaw <[email protected]>; Brandeburg, Jesse 
> <[email protected]>; Julia Lawall <[email protected]>; Lobakin, 
> Aleksander <[email protected]>; [email protected]; 
> [email protected]; [email protected]
> Subject: [Intel-wired-lan] [PATCH iwl-next v2 13/15] ice: field get conversion
>
> Refactor the ice driver to use FIELD_GET() for mask and shift reads,
> which reduces lines of code and adds clarity of intent.
> 
> This code was generated by the following coccinelle/spatch script and
> then manually repaired.
>
> @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]>
> Cc: Julia Lawall <[email protected]>
> Reviewed-by: Marcin Szycik <[email protected]>
> Reviewed-by: Simon Horman <[email protected]>
> Signed-off-by: Jesse Brandeburg <[email protected]>
> ---
> v2: added a couple more get conversions
> ---
>  drivers/net/ethernet/intel/ice/ice_base.c     | 12 +--
>  drivers/net/ethernet/intel/ice/ice_common.c   | 25 +++----
>  drivers/net/ethernet/intel/ice/ice_dcb.c      | 74 ++++++++-----------
>  drivers/net/ethernet/intel/ice/ice_dcb_nl.c   |  2 +-
>  .../net/ethernet/intel/ice/ice_ethtool_fdir.c |  3 +-
>  drivers/net/ethernet/intel/ice/ice_lib.c      |  5 +-
>  drivers/net/ethernet/intel/ice/ice_main.c     | 48 +++++-------
>  drivers/net/ethernet/intel/ice/ice_nvm.c      | 15 ++--
>  drivers/net/ethernet/intel/ice/ice_ptp.c      |  4 +-
>  drivers/net/ethernet/intel/ice/ice_sched.c    |  3 +-
>  drivers/net/ethernet/intel/ice/ice_sriov.c    |  3 +-
>  drivers/net/ethernet/intel/ice/ice_virtchnl.c |  2 +-
>  .../ethernet/intel/ice/ice_virtchnl_fdir.c    | 13 ++--
>  13 files changed, 85 insertions(+), 124 deletions(-)
>

Tested-by: Pucha Himasekhar Reddy <[email protected]> (A 
Contingent worker at Intel)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

Reply via email to