[03/15] tick: Remove useless oneshot ifdeffery

Message ID 20240131231120.12006-4-frederic@kernel.org
State New
Headers
Series timers/nohz cleanups and hotplug reorganization |

Commit Message

Frederic Weisbecker Jan. 31, 2024, 11:11 p.m. UTC
  tick-sched.c is only built when CONFIG_TICK_ONESHOT=y, which is selected
only if CONFIG_NO_HZ_COMMON=y or CONFIG_HIGH_RES_TIMERS=y. Therefore
the related ifdeferry in this file is needless and can be removed.

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/time/tick-sched.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
  

Comments

Anna-Maria Behnsen Feb. 1, 2024, 9:40 a.m. UTC | #1
Frederic Weisbecker <frederic@kernel.org> writes:

> tick-sched.c is only built when CONFIG_TICK_ONESHOT=y, which is selected
> only if CONFIG_NO_HZ_COMMON=y or CONFIG_HIGH_RES_TIMERS=y. Therefore
> the related ifdeferry in this file is needless and can be removed.
>
> Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>

It's a nitpick, but shouldn't the ordering of sob and reviewed-by be the
other way round?

Thanks,

	Anna-Maria
  
Frederic Weisbecker Feb. 1, 2024, 1:16 p.m. UTC | #2
Le Thu, Feb 01, 2024 at 10:40:10AM +0100, Anna-Maria Behnsen a écrit :
> Frederic Weisbecker <frederic@kernel.org> writes:
> 
> > tick-sched.c is only built when CONFIG_TICK_ONESHOT=y, which is selected
> > only if CONFIG_NO_HZ_COMMON=y or CONFIG_HIGH_RES_TIMERS=y. Therefore
> > the related ifdeferry in this file is needless and can be removed.
> >
> > Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
> > Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
> 
> It's a nitpick, but shouldn't the ordering of sob and reviewed-by be the
> other way round?

I've seen it both ways here and there, I'm not sure if there is a strict rule
for it...

> Thanks,
> 
> 	Anna-Maria
>
  
Anna-Maria Behnsen Feb. 1, 2024, 2:04 p.m. UTC | #3
Frederic Weisbecker <frederic@kernel.org> writes:

> Le Thu, Feb 01, 2024 at 10:40:10AM +0100, Anna-Maria Behnsen a écrit :
>> Frederic Weisbecker <frederic@kernel.org> writes:
>> 
>> > tick-sched.c is only built when CONFIG_TICK_ONESHOT=y, which is selected
>> > only if CONFIG_NO_HZ_COMMON=y or CONFIG_HIGH_RES_TIMERS=y. Therefore
>> > the related ifdeferry in this file is needless and can be removed.
>> >
>> > Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
>> > Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
>> 
>> It's a nitpick, but shouldn't the ordering of sob and reviewed-by be the
>> other way round?
>
> I've seen it both ways here and there, I'm not sure if there is a strict rule
> for it...
>

As it is for the tip maintainers, they have some rules - I don't know
how strictly they are used :)

  Documentation/process/maintainer-tip.rst
  

Patch

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index cc19c4ff5a25..e674269692ab 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -43,7 +43,6 @@  struct tick_sched *tick_get_tick_sched(int cpu)
 	return &per_cpu(tick_cpu_sched, cpu);
 }
 
-#if defined(CONFIG_NO_HZ_COMMON) || defined(CONFIG_HIGH_RES_TIMERS)
 /*
  * The time when the last jiffy update happened. Write access must hold
  * jiffies_lock and jiffies_seq. tick_nohz_next_event() needs to get a
@@ -289,7 +288,6 @@  static enum hrtimer_restart tick_nohz_handler(struct hrtimer *timer)
 
 	return HRTIMER_RESTART;
 }
-#endif
 
 #ifdef CONFIG_NO_HZ_FULL
 cpumask_var_t tick_nohz_full_mask;
@@ -635,7 +633,7 @@  void __init tick_nohz_init(void)
 	pr_info("NO_HZ: Full dynticks CPUs: %*pbl.\n",
 		cpumask_pr_args(tick_nohz_full_mask));
 }
-#endif
+#endif /* #ifdef CONFIG_NO_HZ_FULL */
 
 /*
  * NOHZ - aka dynamic tick functionality
@@ -1502,7 +1500,6 @@  void tick_irq_enter(void)
 	tick_nohz_irq_enter();
 }
 
-#if defined CONFIG_NO_HZ_COMMON || defined CONFIG_HIGH_RES_TIMERS
 static int sched_skew_tick;
 
 static int __init skew_tick(char *str)
@@ -1567,7 +1564,6 @@  void tick_cancel_sched_timer(int cpu)
 	ts->idle_calls = idle_calls;
 	ts->idle_sleeps = idle_sleeps;
 }
-#endif /* CONFIG_NO_HZ_COMMON || CONFIG_HIGH_RES_TIMERS */
 
 /*
  * Async notification about clocksource changes