[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BL0PR11MB312212E746C70D4419A3D13FBD85A@BL0PR11MB3122.namprd11.prod.outlook.com>
Date: Tue, 5 Dec 2023 06:38:27 +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: Julia Lawall <Julia.Lawall@...ia.fr>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>, Marcin Szycik <marcin.szycik@...ux.intel.com>,
"Brandeburg, Jesse" <jesse.brandeburg@...el.com>, "Loktionov, Aleksandr"
<aleksandr.loktionov@...el.com>
Subject: RE: [Intel-wired-lan] [PATCH iwl-next v1 11/13] i40e: field get
conversion
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of Jesse Brandeburg
> Sent: Wednesday, November 22, 2023 2:49 AM
> To: intel-wired-lan@...ts.osuosl.org
> Cc: Julia Lawall <Julia.Lawall@...ia.fr>; netdev@...r.kernel.org; Marcin Szycik <marcin.szycik@...ux.intel.com>; Brandeburg, Jesse <jesse.brandeburg@...el.com>; Loktionov, Aleksandr <aleksandr.loktionov@...el.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next v1 11/13] 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.
>
> @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>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@...el.com>
> ---
> 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 | 19 +--
> drivers/net/ethernet/intel/i40e/i40e_xsk.c | 3 +-
> 11 files changed, 144 insertions(+), 225 deletions(-)
>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@...el.com> (A Contingent worker at Intel)
Powered by blists - more mailing lists