[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061204132916.GA24634@flint.arm.linux.org.uk>
Date: Mon, 4 Dec 2006 13:29:16 +0000
From: Russell King <rmk+lkml@....linux.org.uk>
To: David Howells <dhowells@...hat.com>
Cc: Pavel Machek <pavel@....cz>, Roman Zippel <zippel@...ux-m68k.org>,
Al Viro <viro@....linux.org.uk>,
Thomas Gleixner <tglx@...utronix.de>,
Matthew Wilcox <matthew@....cx>,
Linus Torvalds <torvalds@...l.org>, linux-arch@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC] timers, pointers to functions and type safety
On Mon, Dec 04, 2006 at 01:03:29PM +0000, David Howells wrote:
> Russell King <rmk+lkml@....linux.org.uk> wrote:
> > I assume you wanted to delete "data" ?
>
> Yes.
>
> > Your premise is two timer_lists which use one common handler.
> >
> > struct foo {
> > struct timer_list timer1;
> > strucr timer_list timer2;
> > };
>
> That's not what I was thinking of. I was thinking of something much simpler:
>
> struct foo {
> struct timer_list timer;
> };
>
>
> ...
> struct foo *a = kmalloc(sizeof(struct foo), GFP_KERNEL);
> a->timer.fn = do_foo_timer;
> ...
> struct foo *b = kmalloc(sizeof(struct foo), GFP_KERNEL);
> b->timer.fn = do_foo_timer;
> ...
> struct foo *c = kmalloc(sizeof(struct foo), GFP_KERNEL);
> c->timer.fn = do_foo_timer;
> ...
> struct foo *d = kmalloc(sizeof(struct foo), GFP_KERNEL);
> d->timer.fn = do_foo_timer;
> ...
>
> You've now got four copies of struct timer_list, but only one handler.
<re-insert last paragraph of my message until read, understood and
actioned.>
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists