From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Roman Bolshakov <rbolshakov@ddn.com>,
Laurent Vivier <laurent@vivier.eu>,
Eduardo Habkost <eduardo@habkost.net>,
Cameron Esfahani <dirty@apple.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Sunil Muthuswamy <sunilmut@microsoft.com>,
Zhao Liu <zhao1.liu@intel.com>,
Richard Henderson <richard.henderson@linaro.org>,
Fabiano Rosas <farosas@suse.de>,
qemu-trivial@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>,
qemu-block@nongnu.org, Phil Dennis-Jordan <phil@philjordan.eu>,
Michael Tokarev <mjt@tls.msk.ru>, John Snow <jsnow@redhat.com>,
kvm@vger.kernel.org, Laurent Vivier <lvivier@redhat.com>,
Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH v2 06/11] hw/ide/ide-internal: Move dma_buf_commit() into ide "namespace"
Date: Fri, 17 Oct 2025 16:11:12 +0200 [thread overview]
Message-ID: <20251017141117.105944-7-shentey@gmail.com> (raw)
In-Reply-To: <20251017141117.105944-1-shentey@gmail.com>
The identifier suggests that it is a generic DMA function while it is tied
to IDE. Fix this by adding an "ide_" prefix.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/ide/ide-internal.h | 2 +-
hw/ide/ahci.c | 8 ++++----
hw/ide/core.c | 10 +++++-----
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/hw/ide/ide-internal.h b/hw/ide/ide-internal.h
index 0d64805da2..281d07c9d5 100644
--- a/hw/ide/ide-internal.h
+++ b/hw/ide/ide-internal.h
@@ -398,7 +398,7 @@ int64_t ide_get_sector(IDEState *s);
void ide_set_sector(IDEState *s, int64_t sector_num);
void ide_start_dma(IDEState *s, BlockCompletionFunc *cb);
-void dma_buf_commit(IDEState *s, uint32_t tx_bytes);
+void ide_dma_buf_commit(IDEState *s, uint32_t tx_bytes);
void ide_dma_error(IDEState *s);
void ide_abort_command(IDEState *s);
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 1303c21cb7..14bc66fb7f 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1417,7 +1417,7 @@ static void ahci_pio_transfer(const IDEDMA *dma)
}
/* Update number of transferred bytes, destroy sglist */
- dma_buf_commit(s, size);
+ ide_dma_buf_commit(s, size);
out:
/* declare that we processed everything */
@@ -1482,8 +1482,8 @@ static int32_t ahci_dma_prepare_buf(const IDEDMA *dma, int32_t limit)
/**
* Updates the command header with a bytes-read value.
- * Called via dma_buf_commit, for both DMA and PIO paths.
- * sglist destruction is handled within dma_buf_commit.
+ * Called via ide_dma_buf_commit, for both DMA and PIO paths.
+ * sglist destruction is handled within ide_dma_buf_commit.
*/
static void ahci_commit_buf(const IDEDMA *dma, uint32_t tx_bytes)
{
@@ -1511,7 +1511,7 @@ static int ahci_dma_rw_buf(const IDEDMA *dma, bool is_write)
}
/* free sglist, update byte count */
- dma_buf_commit(s, l);
+ ide_dma_buf_commit(s, l);
s->io_buffer_index += l;
trace_ahci_dma_rw_buf(ad->hba, ad->port_no, l);
diff --git a/hw/ide/core.c b/hw/ide/core.c
index b14983ec54..8c380abf7c 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -827,7 +827,7 @@ static void ide_sector_read(IDEState *s)
ide_sector_read_cb, s);
}
-void dma_buf_commit(IDEState *s, uint32_t tx_bytes)
+void ide_dma_buf_commit(IDEState *s, uint32_t tx_bytes)
{
if (s->bus->dma->ops->commit_buf) {
s->bus->dma->ops->commit_buf(s->bus->dma, tx_bytes);
@@ -848,7 +848,7 @@ void ide_set_inactive(IDEState *s, bool more)
void ide_dma_error(IDEState *s)
{
- dma_buf_commit(s, 0);
+ ide_dma_buf_commit(s, 0);
ide_abort_command(s);
ide_set_inactive(s, false);
ide_bus_set_irq(s->bus);
@@ -893,7 +893,7 @@ static void ide_dma_cb(void *opaque, int ret)
if (ret < 0) {
if (ide_handle_rw_error(s, -ret, ide_dma_cmd_to_retry(s->dma_cmd))) {
s->bus->dma->aiocb = NULL;
- dma_buf_commit(s, 0);
+ ide_dma_buf_commit(s, 0);
return;
}
}
@@ -912,7 +912,7 @@ static void ide_dma_cb(void *opaque, int ret)
sector_num = ide_get_sector(s);
if (n > 0) {
assert(n * 512 == s->sg.size);
- dma_buf_commit(s, s->sg.size);
+ ide_dma_buf_commit(s, s->sg.size);
sector_num += n;
ide_set_sector(s, sector_num);
s->nsector -= n;
@@ -944,7 +944,7 @@ static void ide_dma_cb(void *opaque, int ret)
* Reset the Active bit and don't raise the interrupt.
*/
s->status = READY_STAT | SEEK_STAT;
- dma_buf_commit(s, 0);
+ ide_dma_buf_commit(s, 0);
goto eot;
}
--
2.51.1.dirty
next prev parent reply other threads:[~2025-10-17 14:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-17 14:11 [PATCH v2 00/11] Cleanup patches, mostly PC-related Bernhard Beschow
2025-10-17 14:11 ` [PATCH v2 01/11] hw/timer/i8254: Add I/O trace events Bernhard Beschow
2025-10-17 14:11 ` [PATCH v2 02/11] hw/audio/pcspk: " Bernhard Beschow
2025-10-17 14:11 ` [PATCH v2 03/11] hw/rtc/mc146818rtc: Convert CMOS_DPRINTF() into " Bernhard Beschow
2025-10-17 14:11 ` [PATCH v2 04/11] hw/rtc/mc146818rtc: Use ARRAY_SIZE macro Bernhard Beschow
2025-10-17 14:11 ` [PATCH v2 05/11] hw/rtc/mc146818rtc: Assert correct usage of mc146818rtc_set_cmos_data() Bernhard Beschow
2025-10-17 14:11 ` Bernhard Beschow [this message]
2025-10-17 14:11 ` [PATCH v2 07/11] hw/i386/apic: Prefer APICCommonState over DeviceState Bernhard Beschow
2025-10-17 14:11 ` [PATCH v2 08/11] hw/i386/apic: Ensure own APIC use in apic_msr_{read,write} Bernhard Beschow
2025-10-17 14:11 ` [PATCH v2 09/11] hw/intc/apic: Ensure own APIC use in apic_register_{read,write} Bernhard Beschow
2025-10-17 14:58 ` [PATCH v2 09/11] hw/intc/apic: Ensure own APIC use in apic_register_{read, write} Michael Tokarev
2025-10-17 19:34 ` Bernhard Beschow
2025-10-19 22:38 ` Bernhard Beschow
2025-10-17 14:11 ` [PATCH v2 10/11] hw/i386/x86-cpu: Remove now unused cpu_get_current_apic() Bernhard Beschow
2025-10-17 14:11 ` [PATCH v2 11/11] tests/qtest/ds1338-test: Reuse from_bcd() Bernhard Beschow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251017141117.105944-7-shentey@gmail.com \
--to=shentey@gmail.com \
--cc=dirty@apple.com \
--cc=eduardo@habkost.net \
--cc=farosas@suse.de \
--cc=jsnow@redhat.com \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=laurent@vivier.eu \
--cc=lvivier@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mjt@tls.msk.ru \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=phil@philjordan.eu \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=rbolshakov@ddn.com \
--cc=richard.henderson@linaro.org \
--cc=sunilmut@microsoft.com \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox