All of lore.kernel.org
 help / color / mirror / Atom feed
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: Wed, 5 Mar 2008 13:55:36 +1100	[thread overview]
Message-ID: <200803051355.36502.rusty@rustcorp.com.au> (raw)
In-Reply-To: <200802051441.53844.rusty@rustcorp.com.au>

On Tuesday 05 February 2008 14:41:53 Rusty Russell wrote:
> On Tuesday 05 February 2008 01:57:37 Al Viro wrote:
> > On Mon, Feb 04, 2008 at 11:19:44PM +1100, Rusty Russell wrote:
> > > This patch lets timer callback functions have their natural type
> > > (ie. exactly match the data pointer type); it allows the old "unsigned
> > > long data" type as well.
> > >
> > > Downside: if you use the old "unsigned long" callback type, you won't
> > > get a warning if your data is not an unsigned long, due to the cast.
> >
> > No.  There's much saner way to do that and it does not involve any
> > gccisms at all.  I'd posted such patches quite a while ago; normal C
> > constructs are quite sufficient, TYVM.
>
> If you're referring to your 1 Dec 2006 posting, it was enlightening, but I
> was unable to find any patches.

No reply?  I'll try again now.

> > No.  There's much saner way to do that and it does not involve any
> > gccisms at all.

Except typeof, you mean?

> > I'd posted such patches quite a while ago

AFAICT you posted an untested code fragment which won't actually compile 
because the callback in this case returns void.

> > ; normal C constructs are quite sufficient, TYVM.

Your code didn't check the return type, except that it's a pointer or 
int-compatible.  We can do better, as this patch showed.

If you have a "saner way" of doing this in general which is just as effective, 
I look forward to it.  Otherwise you're just managed to delay these 
improvements for another release.

Rusty.

  reply	other threads:[~2008-03-05  2:56 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 [this message]
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

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=200803051355.36502.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.