qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] xlnx_dp: fix iffy xlnx_dp_aux_push_tx_fifo


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] xlnx_dp: fix iffy xlnx_dp_aux_push_tx_fifo
Date: Tue, 21 Jun 2016 16:14:33 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 06/21/2016 08:09 AM, KONRAD Frederic wrote:
> 
> 
> Le 21/06/2016 à 15:16, Paolo Bonzini a écrit :
>> xlnx_dp_aux_push_tx_fifo takes an immediate uint8_t and a buffer length,
>> which must be 1 because that is how many uint8_t's fit in a uint8_t.
>> Sure enough, that is what xlnx_dp_write passes to it, but the function
>> is just weird.  Therefore, make xlnx_dp_aux_push_tx_fifo look like
>> xlnx_dp_aux_push_rx_fifo, taking a pointer to the buffer.
>>
>> Reported by Coverity.
> 

>> +    case DP_AUX_WRITE_FIFO: {
>> +        uint8_t c = value;
>> +        xlnx_dp_aux_push_tx_fifo(s, &c, 1);
>>          break;
>> +    }
> 
> BTW do you need those braces here?

Yes. The declaration of 'c' inside a case label causes (at least some
versions of) gcc to gripe, if it is not in a {} scope.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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