* [PATCH v2] hrtimer: Rename __hrtimer_hres_active() to hrtimer_hres_active()
@ 2024-04-18 2:30 Jiapeng Chong
2024-04-18 8:15 ` Anna-Maria Behnsen
2024-04-22 14:23 ` [tip: timers/core] " tip-bot2 for Jiapeng Chong
0 siblings, 2 replies; 3+ messages in thread
From: Jiapeng Chong @ 2024-04-18 2:30 UTC (permalink / raw)
To: anna-maria; +Cc: frederic, tglx, linux-kernel, Jiapeng Chong, Abaci Robot
The function hrtimer_hres_active() are defined in the hrtimer.c file, but
not called elsewhere, so rename __hrtimer_hres_active() to
hrtimer_hres_active() and remove the old hrtimer_hres_active() function.
kernel/time/hrtimer.c:653:19: warning: unused function 'hrtimer_hres_active'.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8778
Fixes: 82ccdf062a64 ("hrtimer: Remove unused function")
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
Changes in v2:
-Rename __hrtimer_hres_active() to hrtimer_hres_active()
and remove the old hrtimer_hres_active() function.
kernel/time/hrtimer.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index cae9d04b5584..492c14aac642 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -644,17 +644,12 @@ static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base)
/*
* Is the high resolution mode active ?
*/
-static inline int __hrtimer_hres_active(struct hrtimer_cpu_base *cpu_base)
+static inline int hrtimer_hres_active(struct hrtimer_cpu_base *cpu_base)
{
return IS_ENABLED(CONFIG_HIGH_RES_TIMERS) ?
cpu_base->hres_active : 0;
}
-static inline int hrtimer_hres_active(void)
-{
- return __hrtimer_hres_active(this_cpu_ptr(&hrtimer_bases));
-}
-
static void __hrtimer_reprogram(struct hrtimer_cpu_base *cpu_base,
struct hrtimer *next_timer,
ktime_t expires_next)
@@ -678,7 +673,7 @@ static void __hrtimer_reprogram(struct hrtimer_cpu_base *cpu_base,
* set. So we'd effectively block all timers until the T2 event
* fires.
*/
- if (!__hrtimer_hres_active(cpu_base) || cpu_base->hang_detected)
+ if (!hrtimer_hres_active(cpu_base) || cpu_base->hang_detected)
return;
tick_program_event(expires_next, 1);
@@ -789,12 +784,12 @@ static void retrigger_next_event(void *arg)
* function call will take care of the reprogramming in case the
* CPU was in a NOHZ idle sleep.
*/
- if (!__hrtimer_hres_active(base) && !tick_nohz_active)
+ if (!hrtimer_hres_active(base) && !tick_nohz_active)
return;
raw_spin_lock(&base->lock);
hrtimer_update_base(base);
- if (__hrtimer_hres_active(base))
+ if (hrtimer_hres_active(base))
hrtimer_force_reprogram(base, 0);
else
hrtimer_update_next_event(base);
@@ -951,7 +946,7 @@ void clock_was_set(unsigned int bases)
cpumask_var_t mask;
int cpu;
- if (!__hrtimer_hres_active(cpu_base) && !tick_nohz_active)
+ if (!hrtimer_hres_active(cpu_base) && !tick_nohz_active)
goto out_timerfd;
if (!zalloc_cpumask_var(&mask, GFP_KERNEL)) {
@@ -1491,7 +1486,7 @@ u64 hrtimer_get_next_event(void)
raw_spin_lock_irqsave(&cpu_base->lock, flags);
- if (!__hrtimer_hres_active(cpu_base))
+ if (!hrtimer_hres_active(cpu_base))
expires = __hrtimer_get_next_event(cpu_base, HRTIMER_ACTIVE_ALL);
raw_spin_unlock_irqrestore(&cpu_base->lock, flags);
@@ -1514,7 +1509,7 @@ u64 hrtimer_next_event_without(const struct hrtimer *exclude)
raw_spin_lock_irqsave(&cpu_base->lock, flags);
- if (__hrtimer_hres_active(cpu_base)) {
+ if (hrtimer_hres_active(cpu_base)) {
unsigned int active;
if (!cpu_base->softirq_activated) {
@@ -1886,7 +1881,7 @@ void hrtimer_run_queues(void)
unsigned long flags;
ktime_t now;
- if (__hrtimer_hres_active(cpu_base))
+ if (hrtimer_hres_active(cpu_base))
return;
/*
--
2.20.1.7.g153144c
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] hrtimer: Rename __hrtimer_hres_active() to hrtimer_hres_active()
2024-04-18 2:30 [PATCH v2] hrtimer: Rename __hrtimer_hres_active() to hrtimer_hres_active() Jiapeng Chong
@ 2024-04-18 8:15 ` Anna-Maria Behnsen
2024-04-22 14:23 ` [tip: timers/core] " tip-bot2 for Jiapeng Chong
1 sibling, 0 replies; 3+ messages in thread
From: Anna-Maria Behnsen @ 2024-04-18 8:15 UTC (permalink / raw)
To: Jiapeng Chong; +Cc: frederic, tglx, linux-kernel, Jiapeng Chong, Abaci Robot
Jiapeng Chong <jiapeng.chong@linux.alibaba.com> writes:
> The function hrtimer_hres_active() are defined in the hrtimer.c file, but
> not called elsewhere, so rename __hrtimer_hres_active() to
> hrtimer_hres_active() and remove the old hrtimer_hres_active() function.
>
> kernel/time/hrtimer.c:653:19: warning: unused function 'hrtimer_hres_active'.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8778
> Fixes: 82ccdf062a64 ("hrtimer: Remove unused function")
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reviewed-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Thomas, please apply this into timers/core (commit, that is referenced
by Fixes tag is in timers/core).
Thanks,
Anna-Maria
^ permalink raw reply [flat|nested] 3+ messages in thread* [tip: timers/core] hrtimer: Rename __hrtimer_hres_active() to hrtimer_hres_active()
2024-04-18 2:30 [PATCH v2] hrtimer: Rename __hrtimer_hres_active() to hrtimer_hres_active() Jiapeng Chong
2024-04-18 8:15 ` Anna-Maria Behnsen
@ 2024-04-22 14:23 ` tip-bot2 for Jiapeng Chong
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Jiapeng Chong @ 2024-04-22 14:23 UTC (permalink / raw)
To: linux-tip-commits
Cc: Abaci Robot, Jiapeng Chong, Thomas Gleixner, Anna-Maria Behnsen,
x86, linux-kernel
The following commit has been merged into the timers/core branch of tip:
Commit-ID: b7c8e1f8a7b4352c1d0b4310686385e3cf6c104a
Gitweb: https://git.kernel.org/tip/b7c8e1f8a7b4352c1d0b4310686385e3cf6c104a
Author: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
AuthorDate: Thu, 18 Apr 2024 10:30:00 +08:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 22 Apr 2024 16:13:19 +02:00
hrtimer: Rename __hrtimer_hres_active() to hrtimer_hres_active()
The function hrtimer_hres_active() are defined in the hrtimer.c file, but
not called elsewhere, so rename __hrtimer_hres_active() to
hrtimer_hres_active() and remove the old hrtimer_hres_active() function.
kernel/time/hrtimer.c:653:19: warning: unused function 'hrtimer_hres_active'.
Fixes: 82ccdf062a64 ("hrtimer: Remove unused function")
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Link: https://lore.kernel.org/r/20240418023000.130324-1-jiapeng.chong@linux.alibaba.com
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8778
---
kernel/time/hrtimer.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index cae9d04..492c14a 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -644,17 +644,12 @@ static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base)
/*
* Is the high resolution mode active ?
*/
-static inline int __hrtimer_hres_active(struct hrtimer_cpu_base *cpu_base)
+static inline int hrtimer_hres_active(struct hrtimer_cpu_base *cpu_base)
{
return IS_ENABLED(CONFIG_HIGH_RES_TIMERS) ?
cpu_base->hres_active : 0;
}
-static inline int hrtimer_hres_active(void)
-{
- return __hrtimer_hres_active(this_cpu_ptr(&hrtimer_bases));
-}
-
static void __hrtimer_reprogram(struct hrtimer_cpu_base *cpu_base,
struct hrtimer *next_timer,
ktime_t expires_next)
@@ -678,7 +673,7 @@ static void __hrtimer_reprogram(struct hrtimer_cpu_base *cpu_base,
* set. So we'd effectively block all timers until the T2 event
* fires.
*/
- if (!__hrtimer_hres_active(cpu_base) || cpu_base->hang_detected)
+ if (!hrtimer_hres_active(cpu_base) || cpu_base->hang_detected)
return;
tick_program_event(expires_next, 1);
@@ -789,12 +784,12 @@ static void retrigger_next_event(void *arg)
* function call will take care of the reprogramming in case the
* CPU was in a NOHZ idle sleep.
*/
- if (!__hrtimer_hres_active(base) && !tick_nohz_active)
+ if (!hrtimer_hres_active(base) && !tick_nohz_active)
return;
raw_spin_lock(&base->lock);
hrtimer_update_base(base);
- if (__hrtimer_hres_active(base))
+ if (hrtimer_hres_active(base))
hrtimer_force_reprogram(base, 0);
else
hrtimer_update_next_event(base);
@@ -951,7 +946,7 @@ void clock_was_set(unsigned int bases)
cpumask_var_t mask;
int cpu;
- if (!__hrtimer_hres_active(cpu_base) && !tick_nohz_active)
+ if (!hrtimer_hres_active(cpu_base) && !tick_nohz_active)
goto out_timerfd;
if (!zalloc_cpumask_var(&mask, GFP_KERNEL)) {
@@ -1491,7 +1486,7 @@ u64 hrtimer_get_next_event(void)
raw_spin_lock_irqsave(&cpu_base->lock, flags);
- if (!__hrtimer_hres_active(cpu_base))
+ if (!hrtimer_hres_active(cpu_base))
expires = __hrtimer_get_next_event(cpu_base, HRTIMER_ACTIVE_ALL);
raw_spin_unlock_irqrestore(&cpu_base->lock, flags);
@@ -1514,7 +1509,7 @@ u64 hrtimer_next_event_without(const struct hrtimer *exclude)
raw_spin_lock_irqsave(&cpu_base->lock, flags);
- if (__hrtimer_hres_active(cpu_base)) {
+ if (hrtimer_hres_active(cpu_base)) {
unsigned int active;
if (!cpu_base->softirq_activated) {
@@ -1886,7 +1881,7 @@ void hrtimer_run_queues(void)
unsigned long flags;
ktime_t now;
- if (__hrtimer_hres_active(cpu_base))
+ if (hrtimer_hres_active(cpu_base))
return;
/*
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-22 14:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-18 2:30 [PATCH v2] hrtimer: Rename __hrtimer_hres_active() to hrtimer_hres_active() Jiapeng Chong
2024-04-18 8:15 ` Anna-Maria Behnsen
2024-04-22 14:23 ` [tip: timers/core] " tip-bot2 for Jiapeng Chong
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.