qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Qemu-stable] [PATCH] sb16: fix interrupt acknowledgeme


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [Qemu-stable] [PATCH] sb16: fix interrupt acknowledgement
Date: Wed, 21 Jan 2015 11:00:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0


On 21/01/2015 10:32, Michael Tokarev wrote:
>> > --- a/hw/audio/sb16.c
>> > +++ b/hw/audio/sb16.c
>> > @@ -999,7 +999,7 @@ static IO_READ_PROTO (dsp_read)
>> >          retval = (!s->out_data_len || s->highspeed) ? 0 : 0x80;
>> >          if (s->mixer_regs[0x82] & 1) {
>> >              ack = 1;
>> > -            s->mixer_regs[0x82] &= 1;
>> > +            s->mixer_regs[0x82] &= ~1;
> Shouldn't it be ~1u instead?

It's the same since mixer_regs is an array of uint8_t.

I'm not a fan of unsigned suffixes, especially after ~ where most of the
time they're wrong.  For example if x is uint64_t:

   x &= ~1            is right
   x &= ~1ull         is right
   x &= ~1u           also clears bits 32...64
   x &= ~1ul          also clears bits 32...64 on 32-bit machines

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]