Re: [PATCH 3/3] Makes lguest's irq handler typesafe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux