[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200801190917.39349.rusty@rustcorp.com.au>
Date: Sat, 19 Jan 2008 09:17:38 +1100
From: Rusty Russell <rusty@...tcorp.com.au>
To: Jeff Garzik <jgarzik@...ox.com>
Cc: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Ash Willis <ashwillis@...grammer.net>,
linux-pcmcia@...ts.infradead.org,
virtualization@...ts.linux-foundation.org,
Tejun Heo <htejun@...il.com>
Subject: Re: [PATCH 3/3] Makes lguest's irq handler typesafe
On Saturday 19 January 2008 07:45:41 Jeff Garzik wrote:
> Rusty Russell wrote:
> > -static irqreturn_t lguest_interrupt(int irq, void *_vq)
> > +static irqreturn_t lguest_interrupt(int irq, struct virtqueue *vq)
> > {
> > - struct virtqueue *vq = _vq;
> > struct lguest_device_desc *desc = to_lgdev(vq->vdev)->desc;
>
> Ugh.
>
> This will be a compatibility nightmare. I don't see how void* is so
> evil for this, or timers.
The compiler checks types, and we should use it (though note that when I
typesafed the kthread code I didn't find any bugs, so safety arguments must
be muted). The gratuitous casts back and forth are annoying and silly.
The compatibility nightmare is one reason for the previous patch (which you
didn't understand, I hope it's now clear).
> It's not like there's a huge cost associated with a pointer alias.
True, but this is not about performance. It's about making code simpler and
compiler-checkable.
Rusty.
--
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