Le 22/06/2016 à 00:14, Eric Blake a écrit :
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.


Hi Eric,

Makes sense!

Thanks,
Fred

Reply via email to