On Wed, 16 Jun 2021, Philippe Mathieu-Daudé wrote:
On 6/16/21 8:46 PM, Richard Henderson wrote:
On 6/16/21 9:14 AM, Philippe Mathieu-Daudé wrote:
@@ -161,12 +157,11 @@ AUXReply aux_request(AUXBus *bus, AUXCommand
cmd, uint32_t address,
}
ret = AUX_I2C_ACK;
- while (
On 6/16/21 8:46 PM, Richard Henderson wrote:
> On 6/16/21 9:14 AM, Philippe Mathieu-Daudé wrote:
>> @@ -161,12 +157,11 @@ AUXReply aux_request(AUXBus *bus, AUXCommand
>> cmd, uint32_t address,
>> }
>> ret = AUX_I2C_ACK;
>> - while (len > 0) {
>> - if (i2c_sen
On 6/16/21 9:14 AM, Philippe Mathieu-Daudé wrote:
@@ -161,12 +157,11 @@ AUXReply aux_request(AUXBus *bus, AUXCommand cmd,
uint32_t address,
}
ret = AUX_I2C_ACK;
-while (len > 0) {
-if (i2c_send_recv(i2c_bus, data++, true) < 0) {
+for (i = 0; i
Instead of using the confuse i2c_send_recv(), replace
i2c_send_recv(send = true) by i2c_send() and
i2c_send_recv(send = false) by i2c_recv().
During the replacement we also change a while() statement by for().
The resulting code is easier to review.
Signed-off-by: Philippe Mathieu-Daudé
---