On Tue, Nov 21, 2023 at 01:19:14PM -0800, Jesse Brandeburg wrote:
> Refactor ice 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.
> 
> Several places I changed to OR into a single variable with |= instead of
> using a multi-line statement with trailing OR operators, as it
> (subjectively) makes the code clearer.
> 
> A local variable vmvf_and_timeout was created and used to avoid multiple
> logical ORs being __le16 converted, which shortened some lines and makes
> the code cleaner.
> 
> @prep@
> constant shift,mask;
> type T;
> expression a;
> @@
> -(((T)(a) << shift) & mask)
> +FIELD_PREP(mask, a)
> 
> Cc: Julia Lawall <julia.law...@inria.fr>
> Reviewed-by: Marcin Szycik <marcin.szy...@linux.intel.com>
> Signed-off-by: Jesse Brandeburg <jesse.brandeb...@intel.com>

Reviewed-by: Simon Horman <ho...@kernel.org>

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

Reply via email to