[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231124110025.GE50352@kernel.org>
Date: Fri, 24 Nov 2023 11:00:25 +0000
From: Simon Horman <horms@...nel.org>
To: Jesse Brandeburg <jesse.brandeburg@...el.com>
Cc: intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
Julia Lawall <Julia.Lawall@...ia.fr>,
Ahmed Zaki <ahmed.zaki@...el.com>,
Marcin Szycik <marcin.szycik@...ux.intel.com>
Subject: Re: [PATCH iwl-next v1 05/13] iavf: field prep conversion
On Tue, Nov 21, 2023 at 01:19:13PM -0800, Jesse Brandeburg wrote:
> 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);
>
> @prep@
> constant shift,mask;
> expression a;
> @@
> -((a << shift) & mask)
> +FIELD_PREP(mask, a)
>
> Cc: Julia Lawall <Julia.Lawall@...ia.fr>
> Cc: Ahmed Zaki <ahmed.zaki@...el.com>
> Reviewed-by: Marcin Szycik <marcin.szycik@...ux.intel.com>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@...el.com>
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists