]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/ide: Let the DMAIntFunc prototype use a boolean 'is_write' argument
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Wed, 19 Feb 2020 18:08:49 +0000 (19:08 +0100)
committerPhilippe Mathieu-Daudé <philmd@redhat.com>
Thu, 20 Feb 2020 13:47:08 +0000 (14:47 +0100)
The 'is_write' argument is either 0 or 1.
Convert it to a boolean type.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
hw/dma/rc4030.c
hw/ide/ahci.c
hw/ide/core.c
hw/ide/macio.c
hw/ide/pci.c
include/hw/ide/internal.h

index ca0becd7561519bb7be56b93aa2220fba4feeb43..21e2c360ac120874e6bae5feb9c106ea6e5cabca 100644 (file)
@@ -590,7 +590,7 @@ static const VMStateDescription vmstate_rc4030 = {
 };
 
 static void rc4030_do_dma(void *opaque, int n, uint8_t *buf,
-                          int len, int is_write)
+                          int len, bool is_write)
 {
     rc4030State *s = opaque;
     hwaddr dma_addr;
@@ -630,13 +630,13 @@ struct rc4030DMAState {
 void rc4030_dma_read(void *dma, uint8_t *buf, int len)
 {
     rc4030_dma s = dma;
-    rc4030_do_dma(s->opaque, s->n, buf, len, 0);
+    rc4030_do_dma(s->opaque, s->n, buf, len, false);
 }
 
 void rc4030_dma_write(void *dma, uint8_t *buf, int len)
 {
     rc4030_dma s = dma;
-    rc4030_do_dma(s->opaque, s->n, buf, len, 1);
+    rc4030_do_dma(s->opaque, s->n, buf, len, true);
 }
 
 static rc4030_dma *rc4030_allocate_dmas(void *opaque, int n)
index 68264a22e8c12c9329be781bffd37fa4274ee9ae..13d91e109ab3e16eb9368f0973674fb1e46943c3 100644 (file)
@@ -1461,7 +1461,7 @@ static void ahci_commit_buf(IDEDMA *dma, uint32_t tx_bytes)
     ad->cur_cmd->status = cpu_to_le32(tx_bytes);
 }
 
-static int ahci_dma_rw_buf(IDEDMA *dma, int is_write)
+static int ahci_dma_rw_buf(IDEDMA *dma, bool is_write)
 {
     AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma);
     IDEState *s = &ad->port.ifs[0];
index 80000eb7661a89aeecc7f7f435005b27f07a6f1b..689bb36409ed6e901d1df9d875881893a9d54c9d 100644 (file)
@@ -2570,7 +2570,7 @@ static void ide_init1(IDEBus *bus, int unit)
                                            ide_sector_write_timer_cb, s);
 }
 
-static int ide_nop_int(IDEDMA *dma, int x)
+static int ide_nop_int(IDEDMA *dma, bool is_write)
 {
     return 0;
 }
index 7a8470e921955c1d8f4107ec915b1b242a35bdbc..a9f25e5d02f232ede33f02e3e3190cdec5e4a0d2 100644 (file)
@@ -376,7 +376,7 @@ static void macio_ide_reset(DeviceState *dev)
     ide_bus_reset(&d->bus);
 }
 
-static int ide_nop_int(IDEDMA *dma, int x)
+static int ide_nop_int(IDEDMA *dma, bool is_write)
 {
     return 0;
 }
index cce1da804d0dd8ec02d366757a8684a87d8c5130..1a6a287e76c6df3ce14297723daafd96c5a460ec 100644 (file)
@@ -181,7 +181,7 @@ static int32_t bmdma_prepare_buf(IDEDMA *dma, int32_t limit)
 }
 
 /* return 0 if buffer completed */
-static int bmdma_rw_buf(IDEDMA *dma, int is_write)
+static int bmdma_rw_buf(IDEDMA *dma, bool is_write)
 {
     BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma);
     IDEState *s = bmdma_active_if(bm);
index ce766ac485a5d26e038105e125c2787a5aa46b75..1bc1fc73e5fa13a05ef062e57882a0e3ea23af3f 100644 (file)
@@ -322,7 +322,7 @@ typedef void EndTransferFunc(IDEState *);
 
 typedef void DMAStartFunc(IDEDMA *, IDEState *, BlockCompletionFunc *);
 typedef void DMAVoidFunc(IDEDMA *);
-typedef int DMAIntFunc(IDEDMA *, int);
+typedef int DMAIntFunc(IDEDMA *, bool);
 typedef int32_t DMAInt32Func(IDEDMA *, int32_t len);
 typedef void DMAu32Func(IDEDMA *, uint32_t);
 typedef void DMAStopFunc(IDEDMA *, bool);