[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY8PR11MB7195F60B544779EAE94818999794A@CY8PR11MB7195.namprd11.prod.outlook.com>
Date: Fri, 22 Dec 2023 18:48:48 +0000
From: "Register, Scott" <scott.register@...el.com>
To: "Brandeburg, Jesse" <jesse.brandeburg@...el.com>,
"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>
CC: "Kitszel, Przemyslaw" <przemyslaw.kitszel@...el.com>, "Brandeburg, Jesse"
<jesse.brandeburg@...el.com>, "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 15/15] idpf: refactor some
missing field get/prep conversions
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of
> Jesse Brandeburg
> Sent: Tuesday, December 5, 2023 5:01 PM
> To: intel-wired-lan@...ts.osuosl.org
> Cc: Kitszel, Przemyslaw <przemyslaw.kitszel@...el.com>; Brandeburg, Jesse
> <jesse.brandeburg@...el.com>; 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 15/15] idpf: refactor some
> missing field get/prep conversions
>
> Most of idpf correctly uses FIELD_GET and FIELD_PREP, but a couple spots
> were missed so fix those.
>
> Automated conversion with coccinelle script and manually fixed up,
> including audits for opportunities to convert to {get,encode,replace}
> bits functions.
>
> Add conversions to le16_get/encode/replace_bits where appropriate. And
> in one place fix up a cast from a u16 to a u16.
>
> @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)
>
> @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: Alexander Lobakin <aleksander.lobakin@...el.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@...el.com>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@...el.com>
> ---
> v2: merged this patch into larger series, modified after Olek's comments
> to include bits encoding where changing lines for prep or get.
> ---
> .../ethernet/intel/idpf/idpf_singleq_txrx.c | 7 +--
> drivers/net/ethernet/intel/idpf/idpf_txrx.c | 58 +++++++++----------
> 2 files changed, 30 insertions(+), 35 deletions(-)
Tested-by: Scott Register <scott.register@...el.com>
Powered by blists - more mailing lists