From: Simon Horman <horms@kernel.org>
To: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: netdev@vger.kernel.org, marcin.szycik@linux.intel.com,
intel-wired-lan@lists.osuosl.org, przemyslaw.kitszel@intel.com,
aleksander.lobakin@intel.com
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v2 15/15] idpf: refactor some missing field get/prep conversions
Date: Mon, 25 Dec 2023 09:36:22 +0000 [thread overview]
Message-ID: <20231225093622.GF5962@kernel.org> (raw)
In-Reply-To: <20231206010114.2259388-16-jesse.brandeburg@intel.com>
On Tue, Dec 05, 2023 at 05:01:14PM -0800, Jesse Brandeburg wrote:
> 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@intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
WARNING: multiple messages have this Message-ID (diff)
From: Simon Horman <horms@kernel.org>
To: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
aleksander.lobakin@intel.com, przemyslaw.kitszel@intel.com,
marcin.szycik@linux.intel.com
Subject: Re: [PATCH iwl-next v2 15/15] idpf: refactor some missing field get/prep conversions
Date: Mon, 25 Dec 2023 09:36:22 +0000 [thread overview]
Message-ID: <20231225093622.GF5962@kernel.org> (raw)
In-Reply-To: <20231206010114.2259388-16-jesse.brandeburg@intel.com>
On Tue, Dec 05, 2023 at 05:01:14PM -0800, Jesse Brandeburg wrote:
> 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@intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2023-12-25 9:36 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-06 1:00 [Intel-wired-lan] [PATCH iwl-next v2 00/15] intel: use bitfield operations Jesse Brandeburg
2023-12-06 1:00 ` Jesse Brandeburg
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 01/15] e1000e: make lost bits explicit Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-19 7:57 ` [Intel-wired-lan] " naamax.meir
2023-12-19 7:57 ` naamax.meir
2023-12-25 9:36 ` Simon Horman
2023-12-25 9:36 ` Simon Horman
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 02/15] intel: add bit macro includes where needed Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-25 9:35 ` [Intel-wired-lan] " Simon Horman
2023-12-25 9:35 ` Simon Horman
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 03/15] intel: legacy: field prep conversion Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-13 2:58 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-12-13 2:58 ` Pucha, HimasekharX Reddy
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 04/15] i40e: " Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-13 2:58 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-12-13 2:58 ` Pucha, HimasekharX Reddy
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 05/15] iavf: " Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-14 13:08 ` [Intel-wired-lan] " Romanowski, Rafal
2023-12-14 13:08 ` Romanowski, Rafal
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 06/15] ice: " Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-13 2:58 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-12-13 2:58 ` Pucha, HimasekharX Reddy
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 07/15] ice: fix pre-shifted bit usage Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-13 2:57 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-12-13 2:57 ` Pucha, HimasekharX Reddy
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 08/15] igc: field prep conversion Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 09/15] intel: legacy: field get conversion Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-13 2:57 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-12-13 2:57 ` Pucha, HimasekharX Reddy
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 10/15] igc: " Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 11/15] i40e: " Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-13 2:57 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-12-13 2:57 ` Pucha, HimasekharX Reddy
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 12/15] iavf: " Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-14 13:10 ` [Intel-wired-lan] " Romanowski, Rafal
2023-12-14 13:10 ` Romanowski, Rafal
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 13/15] ice: " Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-13 2:57 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-12-13 2:57 ` Pucha, HimasekharX Reddy
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 14/15] ice: cleanup inconsistent code Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-13 2:57 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-12-13 2:57 ` Pucha, HimasekharX Reddy
2023-12-13 4:06 ` Kalesh Anakkur Purayil
2023-12-13 4:06 ` Kalesh Anakkur Purayil
2023-12-13 18:27 ` [Intel-wired-lan] " Jesse Brandeburg
2023-12-13 18:27 ` Jesse Brandeburg
2023-12-14 3:26 ` [Intel-wired-lan] " Kalesh Anakkur Purayil
2023-12-14 3:26 ` Kalesh Anakkur Purayil
2023-12-14 7:16 ` [Intel-wired-lan] " Przemek Kitszel
2023-12-14 7:16 ` Przemek Kitszel
2023-12-25 9:37 ` [Intel-wired-lan] " Simon Horman
2023-12-25 9:37 ` Simon Horman
2023-12-06 1:01 ` [Intel-wired-lan] [PATCH iwl-next v2 15/15] idpf: refactor some missing field get/prep conversions Jesse Brandeburg
2023-12-06 1:01 ` Jesse Brandeburg
2023-12-22 18:48 ` [Intel-wired-lan] " Register, Scott
2023-12-22 18:48 ` Register, Scott
2023-12-25 9:36 ` Simon Horman [this message]
2023-12-25 9:36 ` Simon Horman
2023-12-14 13:09 ` [Intel-wired-lan] [PATCH iwl-next v2 00/15] intel: use bitfield operations Romanowski, Rafal
2023-12-14 13:09 ` Romanowski, Rafal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231225093622.GF5962@kernel.org \
--to=horms@kernel.org \
--cc=aleksander.lobakin@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=marcin.szycik@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=przemyslaw.kitszel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.