> -----Original Message----- > From: Intel-wired-lan <[email protected]> On Behalf Of > Jesse Brandeburg > Sent: Wednesday, December 6, 2023 2:01 AM > To: [email protected] > Cc: Kitszel, Przemyslaw <[email protected]>; Brandeburg, Jesse > <[email protected]>; Zaki, Ahmed <[email protected]>; Julia > Lawall <[email protected]>; Lobakin, Aleksander > <[email protected]>; [email protected]; > [email protected]; [email protected] > Subject: [Intel-wired-lan] [PATCH iwl-next v2 05/15] 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]> > --- > v2: updated commit message > --- > drivers/net/ethernet/intel/iavf/iavf_common.c | 31 ++++++++----------- > drivers/net/ethernet/intel/iavf/iavf_fdir.c | 2 +- > 2 files changed, 14 insertions(+), 19 deletions(-) > > diff --git a/drivers/net/ethernet/intel/iavf/iavf_common.c > b/drivers/net/ethernet/intel/iavf/iavf_common.c > index af5cc69f26e3..5a25233a89d5 100644 > --- a/drivers/net/ethernet/intel/iavf/iavf_common.c > +++ b/drivers/net/ethernet/intel/iavf/iavf_common.c > @@ -331,6 +331,7 @@ static enum iavf_status
Tested-by: Rafal Romanowski <[email protected]> _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
