qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Keith Busch" <kbusch@kernel.org>,
	"Klaus Jensen" <its@irrelevant.dk>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	qemu-block@nongnu.org
Subject: [PATCH-for-7.0 1/2] hw/nvme/ctrl: Have nvme_addr_write() take const buffer
Date: Thu, 11 Nov 2021 16:45:51 +0100	[thread overview]
Message-ID: <20211111154552.2263410-2-philmd@redhat.com> (raw)
In-Reply-To: <20211111154552.2263410-1-philmd@redhat.com>

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 --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) {
-- 
2.31.1



  reply	other threads:[~2021-11-11 16:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 15:45 [PATCH-for-7.0 0/2] hw/nvme/ctrl: Buffer types cleanups Philippe Mathieu-Daudé
2021-11-11 15:45 ` Philippe Mathieu-Daudé [this message]
2021-11-11 15:45 ` [PATCH-for-7.0 2/2] hw/nvme/ctrl: Pass buffers as 'void *' types Philippe Mathieu-Daudé
2021-11-11 18:09 ` [PATCH-for-7.0 0/2] hw/nvme/ctrl: Buffer types cleanups Klaus Jensen
2022-01-26  9:05   ` Klaus Jensen

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=20211111154552.2263410-2-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=its@irrelevant.dk \
    --cc=kbusch@kernel.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).