qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>
To: "its@irrelevant.dk" <its@irrelevant.dk>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
	"k.jensen@samsung.com" <k.jensen@samsung.com>,
	"anaidu.gollu@samsung.com" <anaidu.gollu@samsung.com>,
	"mreitz@redhat.com" <mreitz@redhat.com>,
	"kbusch@kernel.org" <kbusch@kernel.org>
Subject: Re: [PATCH 3/3] hw/block/nvme: align with existing style
Date: Tue, 26 Jan 2021 04:59:07 +0000	[thread overview]
Message-ID: <d9e7de21ed4586659e162f022b30f29cbbf3a3d7.camel@wdc.com> (raw)
In-Reply-To: <20210125082227.20160-4-its@irrelevant.dk>

On Mon, 2021-01-25 at 09:22 +0100, Klaus Jensen wrote:
> 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>

Looks good.
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.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 1be5b54e0fed..98d84fe26644 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 *)&timestamp, sizeof(timestamp),
>                     DMA_DIRECTION_TO_DEVICE, req);
> -    if (ret != NVME_SUCCESS) {
> +    if (ret) {
>          return ret;
>      }
>  
> 
> 
> 


  reply	other threads:[~2021-01-26  5:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25  8:22 [PATCH 0/3] hw/block/nvme: misc fixes Klaus Jensen
2021-01-25  8:22 ` [PATCH 1/3] hw/block/nvme: fix set feature for error recovery Klaus Jensen
2021-01-25  8:22 ` [PATCH 2/3] hw/block/nvme: fix set feature save field check Klaus Jensen
2021-01-25  8:22 ` [PATCH 3/3] hw/block/nvme: align with existing style Klaus Jensen
2021-01-26  4:59   ` Dmitry Fomichev [this message]
2021-01-25 18:02 ` [PATCH 0/3] hw/block/nvme: misc fixes Keith Busch
2021-01-25 18:07   ` 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=d9e7de21ed4586659e162f022b30f29cbbf3a3d7.camel@wdc.com \
    --to=dmitry.fomichev@wdc.com \
    --cc=anaidu.gollu@samsung.com \
    --cc=its@irrelevant.dk \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --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).