public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [patch 2/4] timers: initialisers
Date: Mon, 04 Nov 2002 21:45:33 -0800	[thread overview]
Message-ID: <3DC75AFD.C2EE9DCF@digeo.com> (raw)


Add some infrastructure for statically initialising timers,
use that in workqueues.



 include/linux/timer.h |    9 +++++++++
 1 files changed, 9 insertions(+)

--- 25/include/linux/timer.h~timer-initialiser	Mon Nov  4 21:11:41 2002
+++ 25-akpm/include/linux/timer.h	Mon Nov  4 21:11:49 2002
@@ -22,6 +22,15 @@ struct timer_list {
 
 #define TIMER_MAGIC	0x4b87ad6e
 
+#define TIMER_INITIALIZER(_function, _expires, _data) {		\
+		.function = (_function),			\
+		.expires = (_expires),				\
+		.data = (_data),				\
+		.base = NULL,					\
+		.magic = TIMER_MAGIC,				\
+		.lock = SPIN_LOCK_UNLOCKED,			\
+	}
+
 /***
  * init_timer - initialize a timer.
  * @timer: the timer to be initialized

.

 include/linux/workqueue.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

--- 25/include/linux/workqueue.h~work-initialiser	Mon Nov  4 21:11:51 2002
+++ 25-akpm/include/linux/workqueue.h	Mon Nov  4 21:12:06 2002
@@ -22,7 +22,9 @@ struct work_struct {
 #define __WORK_INITIALIZER(n, f, d) {				\
         .entry	= { &(n).entry, &(n).entry },			\
 	.func = (f),						\
-	.data = (d) }
+	.data = (d),						\
+	.timer = TIMER_INITIALIZER(NULL, 0, 0),			\
+	}
 
 #define DECLARE_WORK(n, f, d)					\
 	struct work_struct n = __WORK_INITIALIZER(n, f, d)

.

                 reply	other threads:[~2002-11-05  5:39 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=3DC75AFD.C2EE9DCF@digeo.com \
    --to=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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