From: Rusty Russell <rusty@rustcorp.com.au>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org, Jeff Garzik <jeff@garzik.org>
Subject: Re: [PATCH 5/5] typesafe: TIMER_INITIALIZER and setup_timer
Date: Mon, 10 Mar 2008 14:42:58 +1100 [thread overview]
Message-ID: <200803101442.58811.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20080310020314.GG27894@ZenIV.linux.org.uk>
On Monday 10 March 2008 13:03:14 Al Viro wrote:
> On Mon, Mar 10, 2008 at 12:07:19PM +1100, Rusty Russell wrote:
> > Worst, I can't see a way to apply your technique in general, for
> > non-void-returning functions (eg. interrupt handlers).
>
> Interrupt handlers are easy. Just switch irqreturn_t from into to
> struct {int x;}, adjust the rest of irqreturn.h accordingly, add
> extern void want_irqreturn_t(irqreturn_t);
> then replace 0 ? (f)(x) : (void)0 with want_irqreturn_t((f)(x)) in the
> expression under sizeof and we are all set (assuming Jeff's elimination
> of irq number in place by then or done in parallel).
Hmm, I was hoping we'd kill irqreturn_t some day: I don't think 2.4
compatibility is worth much any more.
That means doing similar things for stop_machine and kthread_create (just from
looking at this patch series).
The benefits of natural-typed callback args drops if the return type pays the
price.
Cheers,
Rusty.
prev parent reply other threads:[~2008-03-10 3:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-04 12:11 [PATCH 0/5] typesafe callbacks Rusty Russell
2008-02-04 12:14 ` [PATCH 1/5] cast_if_type: allow macros functions which take more than one type Rusty Russell
2008-02-04 12:16 ` [PATCH 2/5] typesafe: Convert stop_machine Rusty Russell
2008-02-04 12:17 ` [PATCH 3/5] typesafe: kthread_create and kthread_run Rusty Russell
2008-02-04 12:18 ` [PATCH 4/5] typesafe: request_irq and devm_request_irq Rusty Russell
2008-02-04 12:19 ` [PATCH 5/5] typesafe: TIMER_INITIALIZER and setup_timer Rusty Russell
2008-02-04 14:57 ` Al Viro
2008-02-05 3:41 ` Rusty Russell
2008-03-05 2:55 ` Rusty Russell
2008-03-06 10:40 ` Al Viro
2008-03-10 1:07 ` Rusty Russell
2008-03-10 2:03 ` Al Viro
2008-03-10 3:42 ` Rusty Russell [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=200803101442.58811.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.