[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 08/16] nvme: remove redundant cmbloc/cmbsz members
From: |
Klaus Jensen |
Subject: |
[PATCH v2 08/16] nvme: remove redundant cmbloc/cmbsz members |
Date: |
Wed, 15 Apr 2020 15:01:51 +0200 |
From: Klaus Jensen <address@hidden>
Signed-off-by: Klaus Jensen <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/block/nvme.c | 7 ++-----
hw/block/nvme.h | 2 --
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 8092c1b46eb1..44856e873fd1 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -66,7 +66,7 @@ static bool nvme_addr_is_cmb(NvmeCtrl *n, hwaddr addr)
static void nvme_addr_read(NvmeCtrl *n, hwaddr addr, void *buf, int size)
{
- if (n->cmbsz && nvme_addr_is_cmb(n, addr)) {
+ if (n->bar.cmbsz && nvme_addr_is_cmb(n, addr)) {
memcpy(buf, (void *)&n->cmbuf[addr - n->ctrl_mem.addr], size);
return;
}
@@ -160,7 +160,7 @@ static uint16_t nvme_map_prp(QEMUSGList *qsg, QEMUIOVector
*iov, uint64_t prp1,
if (unlikely(!prp1)) {
trace_pci_nvme_err_invalid_prp();
return NVME_INVALID_FIELD | NVME_DNR;
- } else if (n->cmbsz && prp1 >= n->ctrl_mem.addr &&
+ } else if (n->bar.cmbsz && prp1 >= n->ctrl_mem.addr &&
prp1 < n->ctrl_mem.addr + int128_get64(n->ctrl_mem.size)) {
qsg->nsg = 0;
qemu_iovec_init(iov, num_prps);
@@ -1425,9 +1425,6 @@ static void nvme_realize(PCIDevice *pci_dev, Error **errp)
NVME_CMBSZ_SET_SZU(n->bar.cmbsz, 2); /* MBs */
NVME_CMBSZ_SET_SZ(n->bar.cmbsz, n->params.cmb_size_mb);
- n->cmbloc = n->bar.cmbloc;
- n->cmbsz = n->bar.cmbsz;
-
n->cmbuf = g_malloc0(NVME_CMBSZ_GETSIZE(n->bar.cmbsz));
memory_region_init_io(&n->ctrl_mem, OBJECT(n), &nvme_cmb_ops, n,
"nvme-cmb", NVME_CMBSZ_GETSIZE(n->bar.cmbsz));
diff --git a/hw/block/nvme.h b/hw/block/nvme.h
index 1617787af2e9..7eecfd3a50f6 100644
--- a/hw/block/nvme.h
+++ b/hw/block/nvme.h
@@ -88,8 +88,6 @@ typedef struct NvmeCtrl {
uint32_t num_namespaces;
uint32_t max_q_ents;
uint64_t ns_size;
- uint32_t cmbsz;
- uint32_t cmbloc;
uint8_t *cmbuf;
uint64_t irq_status;
uint64_t host_timestamp; /* Timestamp sent by the host
*/
--
2.26.0
- Re: [PATCH v2 06/16] nvme: refactor nvme_addr_read, (continued)
- [PATCH v2 03/16] nvme: remove superfluous breaks, Klaus Jensen, 2020/04/15
- [PATCH v2 09/16] nvme: factor out property/constraint checks, Klaus Jensen, 2020/04/15
- [PATCH v2 05/16] nvme: use constants in identify, Klaus Jensen, 2020/04/15
- [PATCH v2 07/16] nvme: add max_ioqpairs device parameter, Klaus Jensen, 2020/04/15
- [PATCH v2 04/16] nvme: move device parameters to separate struct, Klaus Jensen, 2020/04/15
- [PATCH v2 10/16] nvme: factor out device state setup, Klaus Jensen, 2020/04/15
- [PATCH v2 08/16] nvme: remove redundant cmbloc/cmbsz members,
Klaus Jensen <=
- [PATCH v2 02/16] nvme: rename trace events to pci_nvme, Klaus Jensen, 2020/04/15
- [PATCH v2 11/16] nvme: factor out block backend setup, Klaus Jensen, 2020/04/15
- [PATCH v2 14/16] nvme: factor out pci setup, Klaus Jensen, 2020/04/15