From: Jesper Wendel Devantier <jwd@defmacro.it>
To: Klaus Jensen <its@irrelevant.dk>
Cc: Keith Busch <kbusch@kernel.org>,
qemu-block@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Klaus Jensen <k.jensen@samsung.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/nvme: Clean up local variable shadowing in nvme_ns_init()
Date: Tue, 26 Sep 2023 18:51:12 +0200 [thread overview]
Message-ID: <87jzscswnv.fsf@defmacro.it> (raw)
In-Reply-To: <20230925-fix-local-shadowing-v1-1-3a1172132377@samsung.com>
Klaus Jensen <its@irrelevant.dk> writes:
> From: Klaus Jensen <k.jensen@samsung.com>
>
> Fix local variable shadowing in nvme_ns_init().
>
> Reported-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
> ---
> hw/nvme/ns.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c
> index 44aba8f4d9cf..0eabcf5cf500 100644
> --- a/hw/nvme/ns.c
> +++ b/hw/nvme/ns.c
> @@ -107,7 +107,7 @@ static int nvme_ns_init(NvmeNamespace *ns, Error **errp)
>
> ns->pif = ns->params.pif;
>
> - static const NvmeLBAF lbaf[16] = {
> + static const NvmeLBAF defaults[16] = {
> [0] = { .ds = 9 },
> [1] = { .ds = 9, .ms = 8 },
> [2] = { .ds = 9, .ms = 16 },
> @@ -120,7 +120,7 @@ static int nvme_ns_init(NvmeNamespace *ns, Error **errp)
>
> ns->nlbaf = 8;
>
> - memcpy(&id_ns->lbaf, &lbaf, sizeof(lbaf));
> + memcpy(&id_ns->lbaf, &defaults, sizeof(defaults));
>
> for (i = 0; i < ns->nlbaf; i++) {
> NvmeLBAF *lbaf = &id_ns->lbaf[i];
>
> ---
> base-commit: b55e4b9c0525560577384adfc6d30eb0daa8d7be
> change-id: 20230925-fix-local-shadowing-9606793e8ae9
>
> Best regards,
>
Reviewed-by: Jesper Wendel Devantier <j.devantier@samsung.com>
next prev parent reply other threads:[~2023-09-26 16:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 6:05 [PATCH] hw/nvme: Clean up local variable shadowing in nvme_ns_init() Klaus Jensen
2023-09-26 16:51 ` Jesper Wendel Devantier [this message]
2023-09-29 6:57 ` Markus Armbruster
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=87jzscswnv.fsf@defmacro.it \
--to=jwd@defmacro.it \
--cc=armbru@redhat.com \
--cc=its@irrelevant.dk \
--cc=k.jensen@samsung.com \
--cc=kbusch@kernel.org \
--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).