Re: [PATCH v2 9/9] qemu-kvm: hpet: Add MSI support for in-kernel irqchip mode

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

 



On 04/26/2011 04:55 PM, Jan Kiszka wrote:
On 2011-04-26 15:30, Michael Tokarev wrote:
>  26.04.2011 17:19, Jan Kiszka wrote:
>
>>   hw/hpet.c |   71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>
>>  +static int modifying_bit(uint64_t old, uint64_t new, uint64_t mask)
>>  +{
>>  +    return (old ^ new)&  mask;
>>  +}
>
>  Such constructs always look suspicious.  I'm not even sure anymore
>  (after using C for over 20 years ;) that this works... how about
>
>   return (old ^ new)&  mask  ? 1 : 0;
>
>  instead, or something along this?  I mean, if sizeof(int)==4, how
>  `return 1ULL<<32' will be interpreted in this context?  Tiny test
>  program tells me it will return 0...

Good catch, will fix (doesn't bite use here, flags fit into 32 bit, but
nevertheless).


Note, a bool return type works here.

--
error compiling committee.c: too many arguments to function

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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux