* [PATCH] timers: Use the macro LVL_OFFS() to calculate the offset of each level
@ 2021-08-29 6:58 Dianlong Li
0 siblings, 0 replies; only message in thread
From: Dianlong Li @ 2021-08-29 6:58 UTC (permalink / raw)
To: tglx; +Cc: john.stultz, sboyd, linux-kernel, Dianlong Li
offset records the offset of the first bucket of each level,
this can be replaced by the macro LVL_OFFS()
Signed-off-by: Dianlong Li <dianlong_lee@163.com>
---
kernel/time/timer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index e3d2c23c413d..3ee5322157a1 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1522,12 +1522,12 @@ static int next_pending_bucket(struct timer_base *base, unsigned offset,
static unsigned long __next_timer_interrupt(struct timer_base *base)
{
unsigned long clk, next, adj;
- unsigned lvl, offset = 0;
+ unsigned int lvl;
next = base->clk + NEXT_TIMER_MAX_DELTA;
clk = base->clk;
- for (lvl = 0; lvl < LVL_DEPTH; lvl++, offset += LVL_SIZE) {
- int pos = next_pending_bucket(base, offset, clk & LVL_MASK);
+ for (lvl = 0; lvl < LVL_DEPTH; lvl++) {
+ int pos = next_pending_bucket(base, LVL_OFFS(lvl), clk & LVL_MASK);
unsigned long lvl_clk = clk & LVL_CLK_MASK;
if (pos >= 0) {
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-29 7:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-29 6:58 [PATCH] timers: Use the macro LVL_OFFS() to calculate the offset of each level Dianlong Li
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).