[PATCH v5 02/23] crypto: qat - #undef field_get() before local definition

Geert Uytterhoeven posted 23 patches 3 months, 2 weeks ago
There is a newer version of this series
[PATCH v5 02/23] crypto: qat - #undef field_get() before local definition
Posted by Geert Uytterhoeven 3 months, 2 weeks ago
Prepare for the advent of a globally available common field_get() macro
by undefining the symbol before defining a local variant.  This prevents
redefinition warnings from the C preprocessor when introducing the common
macro later.

Suggested-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
--
v5:
  - New.
---
 drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c b/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c
index 69295a9ddf0ac92f..6186fafb4a7b0dab 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c
+++ b/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c
@@ -11,6 +11,7 @@
  * pm_scnprint_table(), making it not compile time constant, so the compile
  * asserts from FIELD_GET() or u32_get_bits() won't be fulfilled.
  */
+#undef field_get
 #define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1))
 
 #define PM_INFO_MAX_KEY_LEN	21
-- 
2.43.0
Re: [PATCH v5 02/23] crypto: qat - #undef field_get() before local definition
Posted by Giovanni Cabiddu 3 months, 1 week ago
On Mon, Oct 27, 2025 at 07:41:36PM +0100, Geert Uytterhoeven wrote:
> Prepare for the advent of a globally available common field_get() macro
> by undefining the symbol before defining a local variant.  This prevents
> redefinition warnings from the C preprocessor when introducing the common
> macro later.
> 
> Suggested-by: Yury Norov <yury.norov@gmail.com>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>

> --
> v5:
>   - New.
> ---
>  drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c b/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c
> index 69295a9ddf0ac92f..6186fafb4a7b0dab 100644
> --- a/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c
> +++ b/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c
> @@ -11,6 +11,7 @@
>   * pm_scnprint_table(), making it not compile time constant, so the compile
>   * asserts from FIELD_GET() or u32_get_bits() won't be fulfilled.
>   */
> +#undef field_get
>  #define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1))
>  
>  #define PM_INFO_MAX_KEY_LEN	21
> -- 
> 2.43.0
>