> -----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 04/15] i40e: field prep > conversion > > Refactor i40e 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. > > Refactor one function with multiple if's to return quickly to make lines > fit in 80 columns. > > @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]> > 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/i40e/i40e_common.c | 83 ++++++------- > drivers/net/ethernet/intel/i40e/i40e_dcb.c | 116 ++++++++---------- > drivers/net/ethernet/intel/i40e/i40e_main.c | 12 +- > drivers/net/ethernet/intel/i40e/i40e_txrx.c | 41 +++---- > .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 8 +- > 5 files changed, 109 insertions(+), 151 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
