linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm/smp: Drop the macro S(x,s)
@ 2020-11-09 11:47 Anshuman Khandual
  2020-11-20  2:32 ` Anshuman Khandual
  0 siblings, 1 reply; 2+ messages in thread
From: Anshuman Khandual @ 2020-11-09 11:47 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Anshuman Khandual, Russell King, 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: Russell King <linux@armlinux.org.uk>
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>
---
Only build tested.

 arch/arm/kernel/smp.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 48099c6e1e4a..6ab2b0ad5f40 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -524,14 +524,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_WAKEUP, "CPU wakeup interrupts"),
-	S(IPI_TIMER, "Timer broadcast interrupts"),
-	S(IPI_RESCHEDULE, "Rescheduling interrupts"),
-	S(IPI_CALL_FUNC, "Function call interrupts"),
-	S(IPI_CPU_STOP, "CPU stop interrupts"),
-	S(IPI_IRQ_WORK, "IRQ work interrupts"),
-	S(IPI_COMPLETION, "completion interrupts"),
+	[IPI_WAKEUP]		= "CPU wakeup interrupts",
+	[IPI_TIMER]		= "Timer broadcast interrupts",
+	[IPI_RESCHEDULE]	= "Rescheduling interrupts",
+	[IPI_CALL_FUNC]		= "Function call interrupts",
+	[IPI_CPU_STOP]		= "CPU stop interrupts",
+	[IPI_IRQ_WORK]		= "IRQ work interrupts",
+	[IPI_COMPLETION]	= "completion interrupts",
 };
 
 static void smp_cross_call(const struct cpumask *target, unsigned int ipinr);
-- 
2.20.1


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

* Re: [PATCH] arm/smp: Drop the macro S(x,s)
  2020-11-09 11:47 [PATCH] arm/smp: Drop the macro S(x,s) Anshuman Khandual
@ 2020-11-20  2:32 ` Anshuman Khandual
  0 siblings, 0 replies; 2+ messages in thread
From: Anshuman Khandual @ 2020-11-20  2:32 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Russell King, Marc Zyngier, linux-kernel



On 11/9/20 5:17 PM, 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: Russell King <linux@armlinux.org.uk>
> 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>
> ---
> Only build tested.

Hello Russel,

Any updates on this ? Considering the patch being just a simple
cleanup, wondering if it can now be submitted in the arm patch
tracking system. Thank you.

- Anshuman
 
> 
>  arch/arm/kernel/smp.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
> index 48099c6e1e4a..6ab2b0ad5f40 100644
> --- a/arch/arm/kernel/smp.c
> +++ b/arch/arm/kernel/smp.c
> @@ -524,14 +524,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_WAKEUP, "CPU wakeup interrupts"),
> -	S(IPI_TIMER, "Timer broadcast interrupts"),
> -	S(IPI_RESCHEDULE, "Rescheduling interrupts"),
> -	S(IPI_CALL_FUNC, "Function call interrupts"),
> -	S(IPI_CPU_STOP, "CPU stop interrupts"),
> -	S(IPI_IRQ_WORK, "IRQ work interrupts"),
> -	S(IPI_COMPLETION, "completion interrupts"),
> +	[IPI_WAKEUP]		= "CPU wakeup interrupts",
> +	[IPI_TIMER]		= "Timer broadcast interrupts",
> +	[IPI_RESCHEDULE]	= "Rescheduling interrupts",
> +	[IPI_CALL_FUNC]		= "Function call interrupts",
> +	[IPI_CPU_STOP]		= "CPU stop interrupts",
> +	[IPI_IRQ_WORK]		= "IRQ work interrupts",
> +	[IPI_COMPLETION]	= "completion interrupts",
>  };
>  
>  static void smp_cross_call(const struct cpumask *target, unsigned int ipinr);
> 

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

end of thread, other threads:[~2020-11-20  2:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 11:47 [PATCH] arm/smp: Drop the macro S(x,s) Anshuman Khandual
2020-11-20  2:32 ` Anshuman Khandual

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).