linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jules Irenge <jbi.octave@gmail.com>
To: tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, boqun.feng@gmail.com,
	Jules Irenge <jbi.octave@gmail.com>
Subject: [PATCH 5/5] time: Add missing annotation for __run_timer()
Date: Mon, 20 Jan 2020 22:43:47 +0000	[thread overview]
Message-ID: <20200120224347.51843-1-jbi.octave@gmail.com> (raw)

Sparse reports a warning at __run_hrtimer()

|warning: context imbalance in __run_hrtimer() - unexpected unlock

To fix this, a must_hold() annotation is added.
Given that __run_hrtimer() requires lock to be held
This  not only fixes the warning
but also improves on the readability of the code.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 kernel/time/hrtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 8de90ea31280..3e94ea58b18d 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1477,7 +1477,7 @@ EXPORT_SYMBOL_GPL(hrtimer_active);
 static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base,
 			  struct hrtimer_clock_base *base,
 			  struct hrtimer *timer, ktime_t *now,
-			  unsigned long flags)
+			  unsigned long flags) __must_hold(&cpu_base->lock)
 {
 	enum hrtimer_restart (*fn)(struct hrtimer *);
 	int restart;
-- 
2.24.1


             reply	other threads:[~2020-01-20 22:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-20 22:43 Jules Irenge [this message]
2020-01-22 14:54 ` [tip: timers/core] hrtimer: Add missing sparse annotation for __run_timer() tip-bot2 for Jules Irenge

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=20200120224347.51843-1-jbi.octave@gmail.com \
    --to=jbi.octave@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).