diff mbox

[RFC,1/5] ARM: remove useless guard in smp.c

Message ID 1355832418-31692-2-git-send-email-mark.rutland@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mark Rutland Dec. 18, 2012, 12:06 p.m. UTC
Currently we only provide an implementation of smp_timer_broadcast in
smp.c if GENERIC_CLOCKEVENTS_BROADCAST is selected. As
smp_timer_broadcast is only used in smp.c, smp.c depends on SMP, and
GENERIC_CLOCKEVENTS_BROADCAST is selected by SMP, this is unnecessary.

This patch removes the redundant guard.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
---
 arch/arm/kernel/smp.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

Comments

Stephen Boyd Dec. 18, 2012, 6:47 p.m. UTC | #1
On 12/18/12 04:06, Mark Rutland wrote:
> Currently we only provide an implementation of smp_timer_broadcast in
> smp.c if GENERIC_CLOCKEVENTS_BROADCAST is selected. As
> smp_timer_broadcast is only used in smp.c, smp.c depends on SMP, and
> GENERIC_CLOCKEVENTS_BROADCAST is selected by SMP, this is unnecessary.

You might want to add that GENERIC_CLOCKEVENTS_BROADCAST depends on
GENERIC_CLOCKEVENTS and SMP depends on GENERIC_CLOCKEVENTS too.

> This patch removes the redundant guard.
>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Mark Rutland Dec. 19, 2012, 9:40 a.m. UTC | #2
On Tue, Dec 18, 2012 at 06:47:09PM +0000, Stephen Boyd wrote:
> On 12/18/12 04:06, Mark Rutland wrote:
> > Currently we only provide an implementation of smp_timer_broadcast in
> > smp.c if GENERIC_CLOCKEVENTS_BROADCAST is selected. As
> > smp_timer_broadcast is only used in smp.c, smp.c depends on SMP, and
> > GENERIC_CLOCKEVENTS_BROADCAST is selected by SMP, this is unnecessary.
> 
> You might want to add that GENERIC_CLOCKEVENTS_BROADCAST depends on
> GENERIC_CLOCKEVENTS and SMP depends on GENERIC_CLOCKEVENTS too.

Will do.

> > This patch removes the redundant guard.
> >
> > Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> 
> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

Thanks!

Mark.
Santosh Shilimkar Dec. 21, 2012, 10:02 a.m. UTC | #3
On Tuesday 18 December 2012 05:36 PM, Mark Rutland wrote:
> Currently we only provide an implementation of smp_timer_broadcast in
> smp.c if GENERIC_CLOCKEVENTS_BROADCAST is selected. As
> smp_timer_broadcast is only used in smp.c, smp.c depends on SMP, and
> GENERIC_CLOCKEVENTS_BROADCAST is selected by SMP, this is unnecessary.
>
> This patch removes the redundant guard.
>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> ---
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST isn't mandatory to
have SMP kernel working so the below select in ARM arch
kconfig not seems to entirely accurate. SMP kernel will
still boot with !GENERIC_CLOCKEVENTS_BROADCAST.

select GENERIC_CLOCKEVENTS_BROADCAST if SMP

The issue comes only for deeper CPU power C-states.
Anyway, you patch is correct from the current code point of
view.

Regards
Santosh
Mark Rutland Jan. 2, 2013, 11:14 a.m. UTC | #4
On Fri, Dec 21, 2012 at 10:02:01AM +0000, Santosh Shilimkar wrote:
> On Tuesday 18 December 2012 05:36 PM, Mark Rutland wrote:
> > Currently we only provide an implementation of smp_timer_broadcast in
> > smp.c if GENERIC_CLOCKEVENTS_BROADCAST is selected. As
> > smp_timer_broadcast is only used in smp.c, smp.c depends on SMP, and
> > GENERIC_CLOCKEVENTS_BROADCAST is selected by SMP, this is unnecessary.
> >
> > This patch removes the redundant guard.
> >
> > Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> > ---
> CONFIG_GENERIC_CLOCKEVENTS_BROADCAST isn't mandatory to
> have SMP kernel working so the below select in ARM arch
> kconfig not seems to entirely accurate. SMP kernel will
> still boot with !GENERIC_CLOCKEVENTS_BROADCAST.
> 
> select GENERIC_CLOCKEVENTS_BROADCAST if SMP

Agreed, the selection is not entirely accurate. I'd be happy to see it made
more fine-grained (i.e. selected by platforms) instead.

If people want that I'm happy to drop this patch.

> The issue comes only for deeper CPU power C-states.
> Anyway, you patch is correct from the current code point of
> view.
> 
> Regards
> Santosh

Thanks,
Mark.
diff mbox

Patch

diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index fbc8b26..21954bc 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -473,14 +473,10 @@  static void ipi_timer(void)
 	evt->event_handler(evt);
 }
 
-#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
 static void smp_timer_broadcast(const struct cpumask *mask)
 {
 	smp_cross_call(mask, IPI_TIMER);
 }
-#else
-#define smp_timer_broadcast	NULL
-#endif
 
 static void broadcast_timer_set_mode(enum clock_event_mode mode,
 	struct clock_event_device *evt)