aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2020-06-23 21:49:15 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2020-06-26 10:13:51 +0100
commitbcaaefdbb2167858d3b92745b79473deb49c417a (patch)
tree6ee2e8b7c0f2d77e01e3c228c3ec1354490f812d /hw
parent5acc270a355120ce967ca1f1eeca0abbdb9303c8 (diff)
downloadqemu-bcaaefdbb2167858d3b92745b79473deb49c417a.zip
qemu-bcaaefdbb2167858d3b92745b79473deb49c417a.tar.gz
qemu-bcaaefdbb2167858d3b92745b79473deb49c417a.tar.bz2
adb: coding style update to fix checkpatch errors
This will help ensure that style guidelines are being maintained during subsequent changes. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Finn Thain <fthain@telegraphics.com.au> Acked-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20200623204936.24064-2-mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw')
-rw-r--r--hw/input/adb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/input/adb.c b/hw/input/adb.c
index b1ac4a3..bf1bc30 100644
--- a/hw/input/adb.c
+++ b/hw/input/adb.c
@@ -44,14 +44,14 @@ int adb_request(ADBBusState *s, uint8_t *obuf, const uint8_t *buf, int len)
cmd = buf[0] & 0xf;
if (cmd == ADB_BUSRESET) {
- for(i = 0; i < s->nb_devices; i++) {
+ for (i = 0; i < s->nb_devices; i++) {
d = s->devices[i];
adb_device_reset(d);
}
return 0;
}
devaddr = buf[0] >> 4;
- for(i = 0; i < s->nb_devices; i++) {
+ for (i = 0; i < s->nb_devices; i++) {
d = s->devices[i];
if (d->devaddr == devaddr) {
ADBDeviceClass *adc = ADB_DEVICE_GET_CLASS(d);
@@ -69,9 +69,10 @@ int adb_poll(ADBBusState *s, uint8_t *obuf, uint16_t poll_mask)
uint8_t buf[1];
olen = 0;
- for(i = 0; i < s->nb_devices; i++) {
- if (s->poll_index >= s->nb_devices)
+ for (i = 0; i < s->nb_devices; i++) {
+ if (s->poll_index >= s->nb_devices) {
s->poll_index = 0;
+ }
d = s->devices[s->poll_index];
if ((1 << d->devaddr) & poll_mask) {
buf[0] = ADB_READREG | (d->devaddr << 4);