[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 16/24] hw/ide: Rename idebus_active_if() -> ide_bus_active_if(
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 16/24] hw/ide: Rename idebus_active_if() -> ide_bus_active_if() |
Date: |
Mon, 20 Feb 2023 10:13:50 +0100 |
idebus_active_if() operates on a IDEBus; rename it as
ide_bus_active_if() to emphasize its first argument
is a IDEBus.
Mechanical change using:
$ sed -i -e 's/idebus_active_if/ide_bus_active_if/g' \
$(git grep -l idebus_active_if)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230215112712.23110-16-philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
hw/ide/core.c | 18 +++++++++---------
hw/ide/macio.c | 8 ++++----
hw/ide/microdrive.c | 4 ++--
hw/ide/pci.c | 2 +-
include/hw/ide/internal.h | 2 +-
5 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index fd2215c506..2d034731cf 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -1265,7 +1265,7 @@ const char
*ATA_IOPORT_WR_lookup[ATA_IOPORT_WR_NUM_REGISTERS] = {
void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
{
IDEBus *bus = opaque;
- IDEState *s = idebus_active_if(bus);
+ IDEState *s = ide_bus_active_if(bus);
int reg_num = addr & 7;
trace_ide_ioport_write(addr, ATA_IOPORT_WR_lookup[reg_num], val, bus, s);
@@ -2128,7 +2128,7 @@ void ide_bus_exec_cmd(IDEBus *bus, uint32_t val)
IDEState *s;
bool complete;
- s = idebus_active_if(bus);
+ s = ide_bus_active_if(bus);
trace_ide_bus_exec_cmd(bus, s, val);
/* ignore commands to non existent slave */
@@ -2195,7 +2195,7 @@ const char
*ATA_IOPORT_RR_lookup[ATA_IOPORT_RR_NUM_REGISTERS] = {
uint32_t ide_ioport_read(void *opaque, uint32_t addr)
{
IDEBus *bus = opaque;
- IDEState *s = idebus_active_if(bus);
+ IDEState *s = ide_bus_active_if(bus);
uint32_t reg_num;
int ret, hob;
@@ -2281,7 +2281,7 @@ uint32_t ide_ioport_read(void *opaque, uint32_t addr)
uint32_t ide_status_read(void *opaque, uint32_t addr)
{
IDEBus *bus = opaque;
- IDEState *s = idebus_active_if(bus);
+ IDEState *s = ide_bus_active_if(bus);
int ret;
if ((!bus->ifs[0].blk && !bus->ifs[1].blk) ||
@@ -2370,7 +2370,7 @@ static bool ide_is_pio_out(IDEState *s)
void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
{
IDEBus *bus = opaque;
- IDEState *s = idebus_active_if(bus);
+ IDEState *s = ide_bus_active_if(bus);
uint8_t *p;
trace_ide_data_writew(addr, val, bus, s);
@@ -2406,7 +2406,7 @@ void ide_data_writew(void *opaque, uint32_t addr,
uint32_t val)
uint32_t ide_data_readw(void *opaque, uint32_t addr)
{
IDEBus *bus = opaque;
- IDEState *s = idebus_active_if(bus);
+ IDEState *s = ide_bus_active_if(bus);
uint8_t *p;
int ret;
@@ -2444,7 +2444,7 @@ uint32_t ide_data_readw(void *opaque, uint32_t addr)
void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
{
IDEBus *bus = opaque;
- IDEState *s = idebus_active_if(bus);
+ IDEState *s = ide_bus_active_if(bus);
uint8_t *p;
trace_ide_data_writel(addr, val, bus, s);
@@ -2472,7 +2472,7 @@ void ide_data_writel(void *opaque, uint32_t addr,
uint32_t val)
uint32_t ide_data_readl(void *opaque, uint32_t addr)
{
IDEBus *bus = opaque;
- IDEState *s = idebus_active_if(bus);
+ IDEState *s = ide_bus_active_if(bus);
uint8_t *p;
int ret;
@@ -2711,7 +2711,7 @@ static void ide_restart_bh(void *opaque)
return;
}
- s = idebus_active_if(bus);
+ s = ide_bus_active_if(bus);
is_read = (bus->error_status & IDE_RETRY_READ) != 0;
/* The error status must be cleared before resubmitting the request: The
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index 6be29e44bc..dca1cc9efc 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -60,7 +60,7 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
{
DBDMA_io *io = opaque;
MACIOIDEState *m = io->opaque;
- IDEState *s = idebus_active_if(&m->bus);
+ IDEState *s = ide_bus_active_if(&m->bus);
int64_t offset;
MACIO_DPRINTF("pmac_ide_atapi_transfer_cb\n");
@@ -136,7 +136,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
{
DBDMA_io *io = opaque;
MACIOIDEState *m = io->opaque;
- IDEState *s = idebus_active_if(&m->bus);
+ IDEState *s = ide_bus_active_if(&m->bus);
int64_t offset;
MACIO_DPRINTF("pmac_ide_transfer_cb\n");
@@ -220,7 +220,7 @@ done:
static void pmac_ide_transfer(DBDMA_io *io)
{
MACIOIDEState *m = io->opaque;
- IDEState *s = idebus_active_if(&m->bus);
+ IDEState *s = ide_bus_active_if(&m->bus);
MACIO_DPRINTF("\n");
@@ -251,7 +251,7 @@ static void pmac_ide_transfer(DBDMA_io *io)
static void pmac_ide_flush(DBDMA_io *io)
{
MACIOIDEState *m = io->opaque;
- IDEState *s = idebus_active_if(&m->bus);
+ IDEState *s = ide_bus_active_if(&m->bus);
if (s->bus->dma->aiocb) {
blk_drain(s->blk);
diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c
index 84452ae4ef..f1017f7333 100644
--- a/hw/ide/microdrive.c
+++ b/hw/ide/microdrive.c
@@ -250,14 +250,14 @@ static uint16_t md_common_read(PCMCIACardState *card,
uint32_t at)
case 0xd: /* Error */
return ide_ioport_read(&s->bus, 0x1);
case 0xe: /* Alternate Status */
- ifs = idebus_active_if(&s->bus);
+ ifs = ide_bus_active_if(&s->bus);
if (ifs->blk) {
return ifs->status;
} else {
return 0;
}
case 0xf: /* Device Address */
- ifs = idebus_active_if(&s->bus);
+ ifs = ide_bus_active_if(&s->bus);
return 0xc2 | ((~ifs->select << 2) & 0x3c);
default:
return ide_ioport_read(&s->bus, at);
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 4223f5e64d..2ddcb49b27 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -296,7 +296,7 @@ void bmdma_cmd_writeb(BMDMAState *bm, uint32_t val)
/* Ignore writes to SSBM if it keeps the old value */
if ((val & BM_CMD_START) != (bm->cmd & BM_CMD_START)) {
if (!(val & BM_CMD_START)) {
- ide_cancel_dma_sync(idebus_active_if(bm->bus));
+ ide_cancel_dma_sync(ide_bus_active_if(bm->bus));
bm->status &= ~BM_STATUS_DMAING;
} else {
bm->cur_addr = bm->addr;
diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
index c687282a78..c2b794150f 100644
--- a/include/hw/ide/internal.h
+++ b/include/hw/ide/internal.h
@@ -566,7 +566,7 @@ static inline uint8_t ide_dma_cmd_to_retry(uint8_t dma_cmd)
return 0;
}
-static inline IDEState *idebus_active_if(IDEBus *bus)
+static inline IDEState *ide_bus_active_if(IDEBus *bus)
{
return bus->ifs + bus->unit;
}
--
2.38.1
- [PATCH v2 08/24] hw/ide: Remove unused 'qapi/qapi-types-run-state.h', (continued)
- [PATCH v2 08/24] hw/ide: Remove unused 'qapi/qapi-types-run-state.h', Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 09/24] hw/ide: Include 'exec/ioport.h' instead of 'hw/isa/isa.h', Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 10/24] hw/ide: Un-inline ide_set_irq(), Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 11/24] hw/ide: Rename ide_set_irq() -> ide_bus_set_irq(), Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 12/24] hw/ide: Rename ide_create_drive() -> ide_bus_create_drive(), Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 13/24] hw/ide: Rename ide_register_restart_cb -> ide_bus_register_restart_cb, Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 14/24] hw/ide: Rename ide_exec_cmd() -> ide_bus_exec_cmd(), Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 15/24] hw/ide: Rename ide_init2() -> ide_bus_init_output_irq(), Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 16/24] hw/ide: Rename idebus_active_if() -> ide_bus_active_if(),
Philippe Mathieu-Daudé <=
- [PATCH v2 20/24] hw/ide/pci: Unexport bmdma_active_if(), Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 17/24] hw/ide: Declare ide_get_[geometry/bios_chs_trans] in 'hw/ide/internal.h', Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 18/24] hw/ide: Rename ISA specific ide_init_ioport -> ide_bus_init_ioport_isa, Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 21/24] hw/ide/piix: Remove unused includes, Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 22/24] hw/ide/piix: Pass Error* to pci_piix_init_ports() for better error msg, Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 19/24] hw/ide/ioport: Remove unnecessary includes, Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 24/24] hw/ide/ahci: trace ncq write command as write instead of read, Philippe Mathieu-Daudé, 2023/02/20
- [PATCH v2 23/24] hw/ide/piix: Refactor pci_piix_init_ports as pci_piix_init_bus per bus, Philippe Mathieu-Daudé, 2023/02/20