From: Oleg Nesterov <oleg@tv-sign.ru>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Christoph Lameter <christoph@lameter.com>,
Andrew Morton <akpm@osdl.org>
Subject: [PATCH 5/5] timers: cleanup, kill __get_base()
Date: Sat, 19 Mar 2005 21:30:50 +0300 [thread overview]
Message-ID: <423C6FDA.D157A3F9@tv-sign.ru> (raw)
__get_base() was added to reduce the changes in
previous patches. This patch removes it.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- 2.6.12-rc1/kernel/timer.c~5_CLEAN 2005-03-19 22:28:34.000000000 +0300
+++ 2.6.12-rc1/kernel/timer.c 2005-03-19 23:34:23.000000000 +0300
@@ -86,16 +86,6 @@ static inline void set_running_timer(tve
#endif
}
-static inline tvec_base_t *__get_base(struct timer_list *timer)
-{
- tvec_base_t *base = timer->_base;
-
- if (__timer_pending(base))
- return (void*)base - __TIMER_PENDING;
- else
- return NULL;
-}
-
static inline void __set_base(struct timer_list *timer,
tvec_base_t *base, int pending)
{
@@ -323,16 +313,18 @@ EXPORT_SYMBOL(mod_timer);
int del_timer(struct timer_list *timer)
{
unsigned long flags;
- tvec_base_t *base;
+ tvec_base_t *_base, *base;
check_timer(timer);
repeat:
- base = __get_base(timer);
- if (!base)
+ _base = timer->_base;
+ if (!__timer_pending(_base))
return 0;
+
+ base = (void*)_base - __TIMER_PENDING;
spin_lock_irqsave(&base->lock, flags);
- if (base != __get_base(timer)) {
+ if (_base != timer->_base) {
spin_unlock_irqrestore(&base->lock, flags);
goto repeat;
}
@@ -445,7 +437,7 @@ static int cascade(tvec_base_t *base, tv
struct timer_list *tmp;
tmp = list_entry(curr, struct timer_list, entry);
- BUG_ON(__get_base(tmp) != base);
+ BUG_ON(tmp->_base != ((void*)base + __TIMER_PENDING));
curr = curr->next;
internal_add_timer(base, tmp);
}
reply other threads:[~2005-03-19 17:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=423C6FDA.D157A3F9@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=akpm@osdl.org \
--cc=christoph@lameter.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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®