> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-boun...@osuosl.org> On Behalf Of Jesse > Brandeburg > Sent: Wednesday, December 6, 2023 6:31 AM > To: intel-wired-...@lists.osuosl.org > Cc: Kitszel, Przemyslaw <przemyslaw.kits...@intel.com>; Brandeburg, Jesse > <jesse.brandeb...@intel.com>; Julia Lawall <julia.law...@inria.fr>; Lobakin, > Aleksander <aleksander.loba...@intel.com>; marcin.szy...@linux.intel.com; > ho...@kernel.org; net...@vger.kernel.org > Subject: [Intel-wired-lan] [PATCH iwl-next v2 09/15] intel: legacy: field get > conversion > > Refactor several older Intel drivers to use FIELD_GET(), 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: Julia Lawall <julia.law...@inria.fr> > CC: Alexander Lobakin <aleksander.loba...@intel.com> > Reviewed-by: Marcin Szycik <marcin.szy...@linux.intel.com> > Reviewed-by: Simon Horman <ho...@kernel.org> > Signed-off-by: Jesse Brandeburg <jesse.brandeb...@intel.com> > --- > v2: update to le16_encode_bits in one spot > --- > drivers/net/ethernet/intel/e1000/e1000_hw.c | 45 ++++++++----------- > .../net/ethernet/intel/e1000e/80003es2lan.c | 3 +- > drivers/net/ethernet/intel/e1000e/82571.c | 3 +- > drivers/net/ethernet/intel/e1000e/ethtool.c | 7 ++- > drivers/net/ethernet/intel/e1000e/ich8lan.c | 18 +++----- > drivers/net/ethernet/intel/e1000e/mac.c | 8 ++-- > drivers/net/ethernet/intel/e1000e/netdev.c | 11 ++--- > drivers/net/ethernet/intel/e1000e/phy.c | 17 +++---- > drivers/net/ethernet/intel/fm10k/fm10k_pf.c | 3 +- > drivers/net/ethernet/intel/fm10k/fm10k_vf.c | 9 ++-- > drivers/net/ethernet/intel/igb/e1000_82575.c | 29 +++++------- > drivers/net/ethernet/intel/igb/e1000_i210.c | 15 ++++--- > drivers/net/ethernet/intel/igb/e1000_mac.c | 7 ++- > drivers/net/ethernet/intel/igb/e1000_nvm.c | 14 +++--- > drivers/net/ethernet/intel/igb/e1000_phy.c | 9 ++-- > drivers/net/ethernet/intel/igb/igb_ethtool.c | 8 ++-- > drivers/net/ethernet/intel/igb/igb_main.c | 4 +- > drivers/net/ethernet/intel/igbvf/mbx.c | 1 + > drivers/net/ethernet/intel/igbvf/netdev.c | 5 +-- > .../net/ethernet/intel/ixgbe/ixgbe_common.c | 30 ++++++------- > drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +- > drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | 8 ++-- > .../net/ethernet/intel/ixgbe/ixgbe_sriov.c | 8 ++-- > drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c | 8 ++-- > drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 19 ++++---- > 25 files changed, 123 insertions(+), 168 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