linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64/smp: Drop the macro S(x,s)
@ 2020-11-09 11:38 Anshuman Khandual
  2020-11-09 11:48 ` Mark Rutland
  2020-11-10 19:17 ` Catalin Marinas
  0 siblings, 2 replies; 3+ messages in thread
From: Anshuman Khandual @ 2020-11-09 11:38 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Anshuman Khandual, Catalin Marinas, Will Deacon, Mark Rutland,
	Marc Zyngier, linux-kernel

Mapping between IPI type index and its string is direct without requiring
an additional offset. Hence the existing macro S(x, s) is now redundant
and can just be dropped. This also makes the code clean and simple.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
 arch/arm64/kernel/smp.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index 09c96f57818c..65d18a618abe 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -786,14 +786,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
 }
 
 static const char *ipi_types[NR_IPI] __tracepoint_string = {
-#define S(x,s)	[x] = s
-	S(IPI_RESCHEDULE, "Rescheduling interrupts"),
-	S(IPI_CALL_FUNC, "Function call interrupts"),
-	S(IPI_CPU_STOP, "CPU stop interrupts"),
-	S(IPI_CPU_CRASH_STOP, "CPU stop (for crash dump) interrupts"),
-	S(IPI_TIMER, "Timer broadcast interrupts"),
-	S(IPI_IRQ_WORK, "IRQ work interrupts"),
-	S(IPI_WAKEUP, "CPU wake-up interrupts"),
+	[IPI_RESCHEDULE]	= "Rescheduling interrupts",
+	[IPI_CALL_FUNC]		= "Function call interrupts",
+	[IPI_CPU_STOP]		= "CPU stop interrupts",
+	[IPI_CPU_CRASH_STOP]	= "CPU stop (for crash dump) interrupts",
+	[IPI_TIMER]		= "Timer broadcast interrupts",
+	[IPI_IRQ_WORK]		= "IRQ work interrupts",
+	[IPI_WAKEUP]		= "CPU wake-up interrupts",
 };
 
 static void smp_cross_call(const struct cpumask *target, unsigned int ipinr);
-- 
2.20.1


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

* Re: [PATCH] arm64/smp: Drop the macro S(x,s)
  2020-11-09 11:38 [PATCH] arm64/smp: Drop the macro S(x,s) Anshuman Khandual
@ 2020-11-09 11:48 ` Mark Rutland
  2020-11-10 19:17 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Rutland @ 2020-11-09 11:48 UTC (permalink / raw)
  To: Anshuman Khandual
  Cc: linux-arm-kernel, Catalin Marinas, Will Deacon, Marc Zyngier,
	linux-kernel

On Mon, Nov 09, 2020 at 05:08:36PM +0530, Anshuman Khandual wrote:
> Mapping between IPI type index and its string is direct without requiring
> an additional offset. Hence the existing macro S(x, s) is now redundant
> and can just be dropped. This also makes the code clean and simple.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>

Nice cleanup!

Acked-by: Mark Rutland <mark.rutland@arm.com>

Mark.

> ---
>  arch/arm64/kernel/smp.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index 09c96f57818c..65d18a618abe 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -786,14 +786,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
>  }
>  
>  static const char *ipi_types[NR_IPI] __tracepoint_string = {
> -#define S(x,s)	[x] = s
> -	S(IPI_RESCHEDULE, "Rescheduling interrupts"),
> -	S(IPI_CALL_FUNC, "Function call interrupts"),
> -	S(IPI_CPU_STOP, "CPU stop interrupts"),
> -	S(IPI_CPU_CRASH_STOP, "CPU stop (for crash dump) interrupts"),
> -	S(IPI_TIMER, "Timer broadcast interrupts"),
> -	S(IPI_IRQ_WORK, "IRQ work interrupts"),
> -	S(IPI_WAKEUP, "CPU wake-up interrupts"),
> +	[IPI_RESCHEDULE]	= "Rescheduling interrupts",
> +	[IPI_CALL_FUNC]		= "Function call interrupts",
> +	[IPI_CPU_STOP]		= "CPU stop interrupts",
> +	[IPI_CPU_CRASH_STOP]	= "CPU stop (for crash dump) interrupts",
> +	[IPI_TIMER]		= "Timer broadcast interrupts",
> +	[IPI_IRQ_WORK]		= "IRQ work interrupts",
> +	[IPI_WAKEUP]		= "CPU wake-up interrupts",
>  };
>  
>  static void smp_cross_call(const struct cpumask *target, unsigned int ipinr);
> -- 
> 2.20.1
> 

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

* Re: [PATCH] arm64/smp: Drop the macro S(x,s)
  2020-11-09 11:38 [PATCH] arm64/smp: Drop the macro S(x,s) Anshuman Khandual
  2020-11-09 11:48 ` Mark Rutland
@ 2020-11-10 19:17 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2020-11-10 19:17 UTC (permalink / raw)
  To: Anshuman Khandual, linux-arm-kernel
  Cc: Will Deacon, Marc Zyngier, linux-kernel, Mark Rutland

On Mon, 9 Nov 2020 17:08:36 +0530, Anshuman Khandual wrote:
> Mapping between IPI type index and its string is direct without requiring
> an additional offset. Hence the existing macro S(x, s) is now redundant
> and can just be dropped. This also makes the code clean and simple.

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

[1/1] arm64/smp: Drop the macro S(x,s)
      https://git.kernel.org/arm64/c/0edaee42eb8c

-- 
Catalin


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

end of thread, other threads:[~2020-11-10 19:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 11:38 [PATCH] arm64/smp: Drop the macro S(x,s) Anshuman Khandual
2020-11-09 11:48 ` Mark Rutland
2020-11-10 19:17 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).