From: "tip-bot2 for Ben Dooks" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Ben Dooks <ben.dooks@codethink.co.uk>,
Thomas Gleixner <tglx@linutronix.de>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/core] hrtimer: Add missing sparse annotations to hrtimer locking
Date: Thu, 22 Jun 2023 08:38:20 -0000 [thread overview]
Message-ID: <168742310100.404.5830952013545972340.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20230621075928.394481-1-ben.dooks@codethink.co.uk>
The following commit has been merged into the timers/core branch of tip:
Commit-ID: ccaa4926c2264ca2a2fcad4b3511fe435d7d4d15
Gitweb: https://git.kernel.org/tip/ccaa4926c2264ca2a2fcad4b3511fe435d7d4d15
Author: Ben Dooks <ben.dooks@codethink.co.uk>
AuthorDate: Wed, 21 Jun 2023 08:59:28 +01:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Thu, 22 Jun 2023 10:32:37 +02:00
hrtimer: Add missing sparse annotations to hrtimer locking
Sparse warns about lock imbalance vs. the hrtimer_base lock due to missing
sparse annotations:
kernel/time/hrtimer.c:175:33: warning: context imbalance in 'lock_hrtimer_base' - wrong count at exit
kernel/time/hrtimer.c:1301:28: warning: context imbalance in 'hrtimer_start_range_ns' - unexpected unlock
kernel/time/hrtimer.c:1336:28: warning: context imbalance in 'hrtimer_try_to_cancel' - unexpected unlock
kernel/time/hrtimer.c:1457:9: warning: context imbalance in '__hrtimer_get_remaining' - unexpected unlock
Add the annotations to the relevant functions.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230621075928.394481-1-ben.dooks@codethink.co.uk
---
kernel/time/hrtimer.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index e8c0829..238262e 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -164,6 +164,7 @@ static inline bool is_migration_base(struct hrtimer_clock_base *base)
static
struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer,
unsigned long *flags)
+ __acquires(&timer->base->lock)
{
struct hrtimer_clock_base *base;
@@ -280,6 +281,7 @@ static inline bool is_migration_base(struct hrtimer_clock_base *base)
static inline struct hrtimer_clock_base *
lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags)
+ __acquires(&timer->base->cpu_base->lock)
{
struct hrtimer_clock_base *base = timer->base;
@@ -1013,6 +1015,7 @@ void hrtimers_resume_local(void)
*/
static inline
void unlock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags)
+ __releases(&timer->base->cpu_base->lock)
{
raw_spin_unlock_irqrestore(&timer->base->cpu_base->lock, *flags);
}
prev parent reply other threads:[~2023-06-22 8:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-21 7:59 [PATCH] hrtimer: fix sparse warnings on " Ben Dooks
2023-06-22 8:38 ` tip-bot2 for Ben Dooks [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=168742310100.404.5830952013545972340.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=ben.dooks@codethink.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®