[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BL0PR11MB312209C4CACD0FCFB5E5AC08BD8DA@BL0PR11MB3122.namprd11.prod.outlook.com>
Date: Wed, 13 Dec 2023 02:57:46 +0000
From: "Pucha, HimasekharX Reddy" <himasekharx.reddy.pucha@...el.com>
To: "Brandeburg, Jesse" <jesse.brandeburg@...el.com>,
"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>
CC: "Loktionov, Aleksandr" <aleksandr.loktionov@...el.com>, "Kitszel,
Przemyslaw" <przemyslaw.kitszel@...el.com>, "Brandeburg, Jesse"
<jesse.brandeburg@...el.com>, Julia Lawall <Julia.Lawall@...ia.fr>, "Lobakin,
Aleksander" <aleksander.lobakin@...el.com>, "marcin.szycik@...ux.intel.com"
<marcin.szycik@...ux.intel.com>, "horms@...nel.org" <horms@...nel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [Intel-wired-lan] [PATCH iwl-next v2 11/15] i40e: field get
conversion
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of Jesse Brandeburg
> Sent: Wednesday, December 6, 2023 6:31 AM
> To: intel-wired-lan@...ts.osuosl.org
> Cc: Loktionov, Aleksandr <aleksandr.loktionov@...el.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@...el.com>; Brandeburg, Jesse <jesse.brandeburg@...el.com>; Julia Lawall <Julia.Lawall@...ia.fr>; Lobakin, Aleksander <aleksander.lobakin@...el.com>; marcin.szycik@...ux.intel.com; horms@...nel.org; netdev@...r.kernel.org
> Subject: [Intel-wired-lan] [PATCH iwl-next v2 11/15] i40e: field get conversion
>
> Refactor the i40e 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.
>
> While making one of the conversions, an if() check was inverted to
> return early and avoid un-necessary indentation of the remainder of the
> function. In some other cases a stack variable was moved inside the
> block where it was used while doing cleanups/review.
>
> A couple places were changed to use le16_get_bits() instead of FIELD_GET
> with a le16_to_cpu combination.
>
> @get@
> constant shift,mask;
> metavariable 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.Lawall@...ia.fr>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@...el.com>
> Reviewed-by: Marcin Szycik <marcin.szycik@...ux.intel.com>
> Reviewed-by: Simon Horman <horms@...nel.org>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@...el.com>
> ---
> v2: add a couple get_bits
> ---
> drivers/net/ethernet/intel/i40e/i40e_common.c | 56 +++----
> drivers/net/ethernet/intel/i40e/i40e_dcb.c | 158 +++++++-----------
> drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c | 3 +-
> drivers/net/ethernet/intel/i40e/i40e_ddp.c | 4 +-
> .../net/ethernet/intel/i40e/i40e_ethtool.c | 7 +-
> drivers/net/ethernet/intel/i40e/i40e_main.c | 73 ++++----
> drivers/net/ethernet/intel/i40e/i40e_nvm.c | 13 +-
> drivers/net/ethernet/intel/i40e/i40e_ptp.c | 4 +-
> drivers/net/ethernet/intel/i40e/i40e_txrx.c | 29 ++--
> .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 21 ++-
> drivers/net/ethernet/intel/i40e/i40e_xsk.c | 3 +-
> 11 files changed, 145 insertions(+), 226 deletions(-)
>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@...el.com> (A Contingent worker at Intel)
Powered by blists - more mailing lists