diff mbox series

[PATCH-for-7.0,1/2] hw/nvme/ctrl: Have nvme_addr_write() take const buffer

Message ID 20211111154552.2263410-2-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series hw/nvme/ctrl: Buffer types cleanups | expand

Commit Message

Philippe Mathieu-Daudé Nov. 11, 2021, 3:45 p.m. UTC
The 'buf' argument is not modified, so better pass it as const type.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/nvme/ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 634b290e069..c7cce63372a 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -377,7 +377,7 @@  static int nvme_addr_read(NvmeCtrl *n, hwaddr addr, void *buf, int size)
     return pci_dma_read(&n->parent_obj, addr, buf, size);
 }
 
-static int nvme_addr_write(NvmeCtrl *n, hwaddr addr, void *buf, int size)
+static int nvme_addr_write(NvmeCtrl *n, hwaddr addr, const void *buf, int size)
 {
     hwaddr hi = addr + size - 1;
     if (hi < addr) {