All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: errata: avoid duplicate field initializer
@ 2022-03-16 18:37 ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2022-03-16 18:37 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: Arnd Bergmann, Suzuki K Poulose, Anshuman Khandual,
	Mathieu Poirier, James Morse, Rich Wiley, linux-arm-kernel,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The '.type' field is initialized both in place and in the macro
as reported by this W=1 warning:

arch/arm64/include/asm/cpufeature.h:281:9: error: initialized field overwritten [-Werror=override-init]
  281 |         (ARM64_CPUCAP_SCOPE_LOCAL_CPU | ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU)
      |         ^
arch/arm64/kernel/cpu_errata.c:136:17: note: in expansion of macro 'ARM64_CPUCAP_LOCAL_CPU_ERRATUM'
  136 |         .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,                         \
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/kernel/cpu_errata.c:145:9: note: in expansion of macro 'ERRATA_MIDR_RANGE'
  145 |         ERRATA_MIDR_RANGE(m, var, r_min, var, r_max)
      |         ^~~~~~~~~~~~~~~~~
arch/arm64/kernel/cpu_errata.c:613:17: note: in expansion of macro 'ERRATA_MIDR_REV_RANGE'
  613 |                 ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2),
      |                 ^~~~~~~~~~~~~~~~~~~~~
arch/arm64/include/asm/cpufeature.h:281:9: note: (near initialization for 'arm64_errata[18].type')
  281 |         (ARM64_CPUCAP_SCOPE_LOCAL_CPU | ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU)
      |         ^

Remove the extranous initializer.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm64/kernel/cpu_errata.c | 1 -
 1 file changed, 1 deletion(-)

I see this warning on 5.17-rc8, but did not test it on linux-next,
which may already have a fix.

diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index a337760f4423..ee7fbd13d030 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -609,7 +609,6 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
 	{
 		.desc = "ARM erratum 2077057",
 		.capability = ARM64_WORKAROUND_2077057,
-		.type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
 		ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2),
 	},
 #endif
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] arm64: errata: avoid duplicate field initializer
@ 2022-03-16 18:37 ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2022-03-16 18:37 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: Arnd Bergmann, Suzuki K Poulose, Anshuman Khandual,
	Mathieu Poirier, James Morse, Rich Wiley, linux-arm-kernel,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The '.type' field is initialized both in place and in the macro
as reported by this W=1 warning:

arch/arm64/include/asm/cpufeature.h:281:9: error: initialized field overwritten [-Werror=override-init]
  281 |         (ARM64_CPUCAP_SCOPE_LOCAL_CPU | ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU)
      |         ^
arch/arm64/kernel/cpu_errata.c:136:17: note: in expansion of macro 'ARM64_CPUCAP_LOCAL_CPU_ERRATUM'
  136 |         .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,                         \
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/arm64/kernel/cpu_errata.c:145:9: note: in expansion of macro 'ERRATA_MIDR_RANGE'
  145 |         ERRATA_MIDR_RANGE(m, var, r_min, var, r_max)
      |         ^~~~~~~~~~~~~~~~~
arch/arm64/kernel/cpu_errata.c:613:17: note: in expansion of macro 'ERRATA_MIDR_REV_RANGE'
  613 |                 ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2),
      |                 ^~~~~~~~~~~~~~~~~~~~~
arch/arm64/include/asm/cpufeature.h:281:9: note: (near initialization for 'arm64_errata[18].type')
  281 |         (ARM64_CPUCAP_SCOPE_LOCAL_CPU | ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU)
      |         ^

Remove the extranous initializer.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm64/kernel/cpu_errata.c | 1 -
 1 file changed, 1 deletion(-)

I see this warning on 5.17-rc8, but did not test it on linux-next,
which may already have a fix.

diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index a337760f4423..ee7fbd13d030 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -609,7 +609,6 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
 	{
 		.desc = "ARM erratum 2077057",
 		.capability = ARM64_WORKAROUND_2077057,
-		.type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
 		ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2),
 	},
 #endif
-- 
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: errata: avoid duplicate field initializer
  2022-03-16 18:37 ` Arnd Bergmann
@ 2022-03-18 18:10   ` Catalin Marinas
  -1 siblings, 0 replies; 4+ messages in thread
From: Catalin Marinas @ 2022-03-18 18:10 UTC (permalink / raw)
  To: Will Deacon, Arnd Bergmann
  Cc: Rich Wiley, James Morse, Mathieu Poirier, linux-arm-kernel,
	Arnd Bergmann, Anshuman Khandual, linux-kernel, Suzuki K Poulose

On Wed, 16 Mar 2022 19:37:45 +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The '.type' field is initialized both in place and in the macro
> as reported by this W=1 warning:
> 
> arch/arm64/include/asm/cpufeature.h:281:9: error: initialized field overwritten [-Werror=override-init]
>   281 |         (ARM64_CPUCAP_SCOPE_LOCAL_CPU | ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU)
>       |         ^
> arch/arm64/kernel/cpu_errata.c:136:17: note: in expansion of macro 'ARM64_CPUCAP_LOCAL_CPU_ERRATUM'
>   136 |         .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,                         \
>       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/arm64/kernel/cpu_errata.c:145:9: note: in expansion of macro 'ERRATA_MIDR_RANGE'
>   145 |         ERRATA_MIDR_RANGE(m, var, r_min, var, r_max)
>       |         ^~~~~~~~~~~~~~~~~
> arch/arm64/kernel/cpu_errata.c:613:17: note: in expansion of macro 'ERRATA_MIDR_REV_RANGE'
>   613 |                 ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2),
>       |                 ^~~~~~~~~~~~~~~~~~~~~
> arch/arm64/include/asm/cpufeature.h:281:9: note: (near initialization for 'arm64_errata[18].type')
>   281 |         (ARM64_CPUCAP_SCOPE_LOCAL_CPU | ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU)
>       |         ^
> 
> [...]

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: errata: avoid duplicate field initializer
      https://git.kernel.org/arm64/c/316e46f65a54

-- 
Catalin


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: errata: avoid duplicate field initializer
@ 2022-03-18 18:10   ` Catalin Marinas
  0 siblings, 0 replies; 4+ messages in thread
From: Catalin Marinas @ 2022-03-18 18:10 UTC (permalink / raw)
  To: Will Deacon, Arnd Bergmann
  Cc: Rich Wiley, James Morse, Mathieu Poirier, linux-arm-kernel,
	Arnd Bergmann, Anshuman Khandual, linux-kernel, Suzuki K Poulose

On Wed, 16 Mar 2022 19:37:45 +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The '.type' field is initialized both in place and in the macro
> as reported by this W=1 warning:
> 
> arch/arm64/include/asm/cpufeature.h:281:9: error: initialized field overwritten [-Werror=override-init]
>   281 |         (ARM64_CPUCAP_SCOPE_LOCAL_CPU | ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU)
>       |         ^
> arch/arm64/kernel/cpu_errata.c:136:17: note: in expansion of macro 'ARM64_CPUCAP_LOCAL_CPU_ERRATUM'
>   136 |         .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,                         \
>       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/arm64/kernel/cpu_errata.c:145:9: note: in expansion of macro 'ERRATA_MIDR_RANGE'
>   145 |         ERRATA_MIDR_RANGE(m, var, r_min, var, r_max)
>       |         ^~~~~~~~~~~~~~~~~
> arch/arm64/kernel/cpu_errata.c:613:17: note: in expansion of macro 'ERRATA_MIDR_REV_RANGE'
>   613 |                 ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2),
>       |                 ^~~~~~~~~~~~~~~~~~~~~
> arch/arm64/include/asm/cpufeature.h:281:9: note: (near initialization for 'arm64_errata[18].type')
>   281 |         (ARM64_CPUCAP_SCOPE_LOCAL_CPU | ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU)
>       |         ^
> 
> [...]

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: errata: avoid duplicate field initializer
      https://git.kernel.org/arm64/c/316e46f65a54

-- 
Catalin


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-18 18:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 18:37 [PATCH] arm64: errata: avoid duplicate field initializer Arnd Bergmann
2022-03-16 18:37 ` Arnd Bergmann
2022-03-18 18:10 ` Catalin Marinas
2022-03-18 18:10   ` Catalin Marinas

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.