[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 53/56] hw/block/nvme: align with existing style
From: |
Klaus Jensen |
Subject: |
[PULL 53/56] hw/block/nvme: align with existing style |
Date: |
Tue, 9 Feb 2021 08:30:58 +0100 |
From: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Change status checks to align with the existing style and remove the
explicit check against NVME_SUCCESS.
Cc: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
hw/block/nvme.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index c99a3fbf3461..2335739bdb17 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -1198,7 +1198,7 @@ static uint16_t nvme_check_zone_write(NvmeCtrl *n,
NvmeNamespace *ns,
status = nvme_check_zone_state_for_write(zone);
}
- if (status != NVME_SUCCESS) {
+ if (status) {
trace_pci_nvme_err_zone_write_not_ok(slba, nlb, status);
} else {
assert(nvme_wp_is_valid(zone));
@@ -1253,7 +1253,7 @@ static uint16_t nvme_check_zone_read(NvmeNamespace *ns,
uint64_t slba,
uint16_t status;
status = nvme_check_zone_state_for_read(zone);
- if (status != NVME_SUCCESS) {
+ if (status) {
;
} else if (unlikely(end > bndry)) {
if (!ns->params.cross_zone_read) {
@@ -1266,7 +1266,7 @@ static uint16_t nvme_check_zone_read(NvmeNamespace *ns,
uint64_t slba,
do {
zone++;
status = nvme_check_zone_state_for_read(zone);
- if (status != NVME_SUCCESS) {
+ if (status) {
break;
}
} while (end > nvme_zone_rd_boundary(ns, zone));
@@ -1677,7 +1677,7 @@ static uint16_t nvme_read(NvmeCtrl *n, NvmeRequest *req)
if (ns->params.zoned) {
status = nvme_check_zone_read(ns, slba, nlb);
- if (status != NVME_SUCCESS) {
+ if (status) {
trace_pci_nvme_err_zone_read_not_ok(slba, nlb, status);
goto invalid;
}
@@ -1748,12 +1748,12 @@ static uint16_t nvme_do_write(NvmeCtrl *n, NvmeRequest
*req, bool append,
zone = nvme_get_zone_by_slba(ns, slba);
status = nvme_check_zone_write(n, ns, zone, slba, nlb, append);
- if (status != NVME_SUCCESS) {
+ if (status) {
goto invalid;
}
status = nvme_auto_open_zone(ns, zone);
- if (status != NVME_SUCCESS) {
+ if (status) {
goto invalid;
}
@@ -1852,14 +1852,14 @@ static uint16_t nvme_open_zone(NvmeNamespace *ns,
NvmeZone *zone,
switch (state) {
case NVME_ZONE_STATE_EMPTY:
status = nvme_aor_check(ns, 1, 0);
- if (status != NVME_SUCCESS) {
+ if (status) {
return status;
}
nvme_aor_inc_active(ns);
/* fall through */
case NVME_ZONE_STATE_CLOSED:
status = nvme_aor_check(ns, 0, 1);
- if (status != NVME_SUCCESS) {
+ if (status) {
if (state == NVME_ZONE_STATE_EMPTY) {
nvme_aor_dec_active(ns);
}
@@ -1972,7 +1972,7 @@ static uint16_t nvme_set_zd_ext(NvmeNamespace *ns,
NvmeZone *zone)
if (state == NVME_ZONE_STATE_EMPTY) {
status = nvme_aor_check(ns, 1, 0);
- if (status != NVME_SUCCESS) {
+ if (status) {
return status;
}
nvme_aor_inc_active(ns);
@@ -3301,7 +3301,7 @@ static uint16_t nvme_set_feature_timestamp(NvmeCtrl *n,
NvmeRequest *req)
ret = nvme_dma(n, (uint8_t *)×tamp, sizeof(timestamp),
DMA_DIRECTION_TO_DEVICE, req);
- if (ret != NVME_SUCCESS) {
+ if (ret) {
return ret;
}
--
2.30.0
- [PULL 43/56] hw/block/nvme: rename PMR/CMB shift/mask fields, (continued)
- [PULL 43/56] hw/block/nvme: rename PMR/CMB shift/mask fields, Klaus Jensen, 2021/02/09
- [PULL 47/56] hw/block/nvme: move cmb logic to v1.4, Klaus Jensen, 2021/02/09
- [PULL 42/56] hw/block/nvme: allow cmb and pmr to coexist, Klaus Jensen, 2021/02/09
- [PULL 41/56] hw/block/nvme: move msix table and pba to BAR 0, Klaus Jensen, 2021/02/09
- [PULL 36/56] hw/block/nvme: add smart_critical_warning property, Klaus Jensen, 2021/02/09
- [PULL 50/56] hw/block/nvme: error if drive less than a zone size, Klaus Jensen, 2021/02/09
- [PULL 51/56] hw/block/nvme: fix set feature for error recovery, Klaus Jensen, 2021/02/09
- [PULL 40/56] hw/block/nvme: indicate CMB support through controller capabilities register, Klaus Jensen, 2021/02/09
- [PULL 46/56] hw/block/nvme: add PMR RDS/WDS support, Klaus Jensen, 2021/02/09
- [PULL 49/56] hw/block/nvme: lift cmb restrictions, Klaus Jensen, 2021/02/09
- [PULL 53/56] hw/block/nvme: align with existing style,
Klaus Jensen <=
- [PULL 54/56] hw/block/nvme: fix wrong parameter name 'cross_read', Klaus Jensen, 2021/02/09
- [PULL 55/56] hw/block/nvme: fix zone boundary check for append, Klaus Jensen, 2021/02/09
- [PULL 56/56] hw/block/nvme: refactor the logic for zone write checks, Klaus Jensen, 2021/02/09
- [PULL 52/56] hw/block/nvme: fix set feature save field check, Klaus Jensen, 2021/02/09
- Re: [PULL 00/56] emulated nvme patches, Peter Maydell, 2021/02/09