> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-boun...@osuosl.org> On Behalf Of Jesse > Brandeburg > Sent: Wednesday, November 22, 2023 2:49 AM > To: intel-wired-...@lists.osuosl.org > Cc: Julia Lawall <julia.law...@inria.fr>; net...@vger.kernel.org; Marcin > Szycik <marcin.szy...@linux.intel.com>; Brandeburg, Jesse > <jesse.brandeb...@intel.com> > Subject: [Intel-wired-lan] [PATCH iwl-next v1 06/13] 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. > > @prep@ > constant shift,mask; > type T; > expression a; > @@ > -(((T)(a) << shift) & mask) > +FIELD_PREP(mask, a) > > Cc: Julia Lawall <julia.law...@inria.fr> > Reviewed-by: Marcin Szycik <marcin.szy...@linux.intel.com> > Signed-off-by: Jesse Brandeburg <jesse.brandeb...@intel.com> > --- > drivers/net/ethernet/intel/ice/ice_base.c | 20 +++--- > drivers/net/ethernet/intel/ice/ice_common.c | 23 +++---- > drivers/net/ethernet/intel/ice/ice_dcb.c | 3 +- > drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 2 +- > drivers/net/ethernet/intel/ice/ice_eswitch.c | 4 +- > drivers/net/ethernet/intel/ice/ice_fdir.c | 69 +++++++------------ > .../net/ethernet/intel/ice/ice_flex_pipe.c | 8 +-- > drivers/net/ethernet/intel/ice/ice_flow.c | 2 +- > drivers/net/ethernet/intel/ice/ice_lib.c | 52 +++++--------- > drivers/net/ethernet/intel/ice/ice_ptp.c | 9 ++- > drivers/net/ethernet/intel/ice/ice_sriov.c | 38 ++++------ > drivers/net/ethernet/intel/ice/ice_switch.c | 61 ++++++++-------- > drivers/net/ethernet/intel/ice/ice_txrx.c | 6 +- > drivers/net/ethernet/intel/ice/ice_virtchnl.c | 8 +-- > .../ethernet/intel/ice/ice_virtchnl_fdir.c | 2 +- > .../net/ethernet/intel/ice/ice_vsi_vlan_lib.c | 19 ++--- > 16 files changed, 130 insertions(+), 196 deletions(-) >
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pu...@intel.com> (A Contingent worker at Intel) _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan