On Sun, 2008-11-30 at 12:28 +0200, Avi Kivity wrote:
> Mark McLoughlin wrote:
> > Allow kvm_free_irq_source_id() to be called with a zero ID.
> >
> > Zero is reserved for KVM_USERSPACE_IRQ_SOURCE_ID, so we can
> > guarantee that kvm_request_irq_source_id() will never return
> > zero and use zero to indicate "no source ID allocated".
> >
> >   
> 
> Zero is a legal value for irq source ids, overloading it as something 
> else is confusing.

Fair enough; I choose zero because it's naturally initialised to that by
the kzalloc(). But I prefer explicit initialisation anyway, so ...

> Things should continue to work if we #define it to 17.

Okay, let's try with -1 then.

> > +   ASSERT(irq_source_id != 0); /* KVM_USERSPACE_IRQ_SOURCE_ID reserved */
> >   
> 
> Why not replace 0 with the actual symbolic constant?

Because I was giving 0 two meanings :-)

Respin of the patches coming up.

Cheers,
Mark.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to