All of lore.kernel.org
 help / color / mirror / Atom feed
From: Klaus Jensen <its@irrelevant.dk>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>, "Kevin Wolf" <kwolf@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	qemu-block@nongnu.org, "Klaus Jensen" <k.jensen@samsung.com>,
	"Max Reitz" <mreitz@redhat.com>,
	"Keith Busch" <kbusch@kernel.org>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Klaus Jensen" <its@irrelevant.dk>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [PULL 09/20] hw/block/nvme: rename __nvme_select_ns_iocs
Date: Mon, 17 May 2021 11:17:26 +0200	[thread overview]
Message-ID: <20210517091737.841787-10-its@irrelevant.dk> (raw)
In-Reply-To: <20210517091737.841787-1-its@irrelevant.dk>

From: Klaus Jensen <k.jensen@samsung.com>

Get rid of the (reserved) double underscore use.

Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
---
 hw/block/nvme.c | 47 +++++++++++++++++++++++------------------------
 1 file changed, 23 insertions(+), 24 deletions(-)

diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index acbfa3f890dc..f0cfca869875 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -4928,7 +4928,25 @@ static void nvme_update_dmrsl(NvmeCtrl *n)
     }
 }
 
-static void __nvme_select_ns_iocs(NvmeCtrl *n, NvmeNamespace *ns);
+static void nvme_select_iocs_ns(NvmeCtrl *n, NvmeNamespace *ns)
+{
+    ns->iocs = nvme_cse_iocs_none;
+    switch (ns->csi) {
+    case NVME_CSI_NVM:
+        if (NVME_CC_CSS(n->bar.cc) != NVME_CC_CSS_ADMIN_ONLY) {
+            ns->iocs = nvme_cse_iocs_nvm;
+        }
+        break;
+    case NVME_CSI_ZONED:
+        if (NVME_CC_CSS(n->bar.cc) == NVME_CC_CSS_CSI) {
+            ns->iocs = nvme_cse_iocs_zoned;
+        } else if (NVME_CC_CSS(n->bar.cc) == NVME_CC_CSS_NVM) {
+            ns->iocs = nvme_cse_iocs_nvm;
+        }
+        break;
+    }
+}
+
 static uint16_t nvme_ns_attachment(NvmeCtrl *n, NvmeRequest *req)
 {
     NvmeNamespace *ns;
@@ -4979,7 +4997,7 @@ static uint16_t nvme_ns_attachment(NvmeCtrl *n, NvmeRequest *req)
             }
 
             nvme_attach_ns(ctrl, ns);
-            __nvme_select_ns_iocs(ctrl, ns);
+            nvme_select_iocs_ns(ctrl, ns);
         } else {
             if (!nvme_ns(ctrl, nsid)) {
                 return NVME_NS_NOT_ATTACHED | NVME_DNR;
@@ -5280,26 +5298,7 @@ static void nvme_ctrl_shutdown(NvmeCtrl *n)
     }
 }
 
-static void __nvme_select_ns_iocs(NvmeCtrl *n, NvmeNamespace *ns)
-{
-    ns->iocs = nvme_cse_iocs_none;
-    switch (ns->csi) {
-    case NVME_CSI_NVM:
-        if (NVME_CC_CSS(n->bar.cc) != NVME_CC_CSS_ADMIN_ONLY) {
-            ns->iocs = nvme_cse_iocs_nvm;
-        }
-        break;
-    case NVME_CSI_ZONED:
-        if (NVME_CC_CSS(n->bar.cc) == NVME_CC_CSS_CSI) {
-            ns->iocs = nvme_cse_iocs_zoned;
-        } else if (NVME_CC_CSS(n->bar.cc) == NVME_CC_CSS_NVM) {
-            ns->iocs = nvme_cse_iocs_nvm;
-        }
-        break;
-    }
-}
-
-static void nvme_select_ns_iocs(NvmeCtrl *n)
+static void nvme_select_iocs(NvmeCtrl *n)
 {
     NvmeNamespace *ns;
     int i;
@@ -5310,7 +5309,7 @@ static void nvme_select_ns_iocs(NvmeCtrl *n)
             continue;
         }
 
-        __nvme_select_ns_iocs(n, ns);
+        nvme_select_iocs_ns(n, ns);
     }
 }
 
@@ -5412,7 +5411,7 @@ static int nvme_start_ctrl(NvmeCtrl *n)
 
     QTAILQ_INIT(&n->aer_queue);
 
-    nvme_select_ns_iocs(n);
+    nvme_select_iocs(n);
 
     return 0;
 }
-- 
2.31.1



  parent reply	other threads:[~2021-05-17  9:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17  9:17 [PULL 00/20] emulated nvme updates Klaus Jensen
2021-05-17  9:17 ` [PULL 01/20] hw/block/nvme: remove redundant invalid_lba_range trace Klaus Jensen
2021-05-17  9:17 ` [PULL 02/20] hw/block/nvme: rename reserved fields declarations Klaus Jensen
2021-05-17  9:17 ` [PULL 03/20] hw/block/nvme: consider metadata read aio return value in compare Klaus Jensen
2021-05-17  9:17 ` [PULL 04/20] hw/block/nvme: fix io-command set profile feature Klaus Jensen
2021-05-17  9:17 ` [PULL 05/20] hw/block/nvme: function formatting fix Klaus Jensen
2021-05-17  9:17 ` [PULL 06/20] hw/block/nvme: align with existing style Klaus Jensen
2021-05-17  9:17 ` [PULL 07/20] hw/block/nvme: rename __nvme_zrm_open Klaus Jensen
2021-05-17  9:17 ` [PULL 08/20] hw/block/nvme: rename __nvme_advance_zone_wp Klaus Jensen
2021-05-17  9:17 ` Klaus Jensen [this message]
2021-05-17  9:17 ` [PULL 10/20] hw/block/nvme: consolidate header files Klaus Jensen
2021-05-17  9:17 ` [PULL 11/20] hw/block/nvme: cleanup includes Klaus Jensen
2021-05-17  9:17 ` [PULL 12/20] hw/block/nvme: remove non-shared defines from header file Klaus Jensen
2021-05-17  9:17 ` [PULL 13/20] hw/block/nvme: replace nvme_ns_status Klaus Jensen
2021-05-17  9:17 ` [PULL 14/20] hw/block/nvme: cache lba and ms sizes Klaus Jensen
2021-05-17  9:17 ` [PULL 15/20] hw/block/nvme: add metadata offset helper Klaus Jensen
2021-05-17  9:17 ` [PULL 16/20] hw/block/nvme: streamline namespace array indexing Klaus Jensen
2021-05-17  9:17 ` [PULL 17/20] hw/block/nvme: remove num_namespaces member Klaus Jensen
2021-05-17  9:17 ` [PULL 18/20] hw/block/nvme: remove irrelevant zone resource checks Klaus Jensen
2021-05-17  9:17 ` [PULL 19/20] hw/block/nvme: move zoned constraints checks Klaus Jensen
2021-05-17  9:17 ` [PULL 20/20] hw/nvme: move nvme emulation out of hw/block Klaus Jensen
2021-05-18 13:12 ` [PULL 00/20] emulated nvme updates Peter Maydell

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=20210517091737.841787-10-its@irrelevant.dk \
    --to=its@irrelevant.dk \
    --cc=fam@euphon.net \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.