All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Fam Zheng <fam@euphon.net>, Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH v2 3/6] block/nvme: Reduce I/O registers scope
Date: Fri, 25 Sep 2020 16:34:06 +0100	[thread overview]
Message-ID: <20200925153406.GB343759@stefanha-x1.localdomain> (raw)
In-Reply-To: <20200922083821.578519-4-philmd@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 600 bytes --]

On Tue, Sep 22, 2020 at 10:38:18AM +0200, Philippe Mathieu-Daudé wrote:
> @@ -808,6 +808,10 @@ static int nvme_init(BlockDriverState *bs, const char *device, int namespace,
>          ret = -EIO;
>      }
>  out:
> +    if (regs) {
> +        qemu_vfio_pci_unmap_bar(s->vfio, 0, (void *)regs, 0, sizeof(NvmeBar));
> +    }

qemu_vfio_pci_unmap_bar(NULL) is a nop, so the check is unnecessary.  I
didn't look to see whether the doorbells can be NULL too during unmap,
but if yes, then it's clearer to be consistent (always check NULL or
never check NULL).

Not worth respinning though.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-09-25 15:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  8:38 [PATCH v2 0/6] block/nvme: Map doorbells pages write-only, remove magic from nvme_init Philippe Mathieu-Daudé
2020-09-22  8:38 ` [PATCH v2 1/6] util/vfio-helpers: Pass page protections to qemu_vfio_pci_map_bar() Philippe Mathieu-Daudé
2020-09-22  8:38 ` [PATCH v2 2/6] block/nvme: Map doorbells pages write-only Philippe Mathieu-Daudé
2020-09-22  8:38 ` [PATCH v2 3/6] block/nvme: Reduce I/O registers scope Philippe Mathieu-Daudé
2020-09-25 15:34   ` Stefan Hajnoczi [this message]
2020-09-22  8:38 ` [PATCH v2 4/6] block/nvme: Drop NVMeRegs structure, directly use NvmeBar Philippe Mathieu-Daudé
2020-09-22  8:38 ` [PATCH v2 5/6] block/nvme: Use register definitions from 'block/nvme.h' Philippe Mathieu-Daudé
2020-09-22  8:38 ` [PATCH v2 6/6] block/nvme: Replace magic value by SCALE_MS definition Philippe Mathieu-Daudé
2020-09-22  8:43 ` [PATCH v2 0/6] block/nvme: Map doorbells pages write-only, remove magic from nvme_init no-reply
2020-09-22  9:45 ` Fam Zheng
2020-09-25 15:37 ` Stefan Hajnoczi

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=20200925153406.GB343759@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=philmd@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 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.