Browse Source

hw/nvme: Clean up local variable shadowing in nvme_ns_init()

Fix local variable shadowing in nvme_ns_init().

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Message-ID: <20230925-fix-local-shadowing-v1-1-3a1172132377@samsung.com>
Reviewed-by: Jesper Wendel Devantier <j.devantier@samsung.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Klaus Jensen 1 year ago
parent
commit
f193d0bde7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      hw/nvme/ns.c

+ 2 - 2
hw/nvme/ns.c

@@ -107,7 +107,7 @@ static int nvme_ns_init(NvmeNamespace *ns, Error **errp)
 
 
     ns->pif = ns->params.pif;
     ns->pif = ns->params.pif;
 
 
-    static const NvmeLBAF lbaf[16] = {
+    static const NvmeLBAF defaults[16] = {
         [0] = { .ds =  9           },
         [0] = { .ds =  9           },
         [1] = { .ds =  9, .ms =  8 },
         [1] = { .ds =  9, .ms =  8 },
         [2] = { .ds =  9, .ms = 16 },
         [2] = { .ds =  9, .ms = 16 },
@@ -120,7 +120,7 @@ static int nvme_ns_init(NvmeNamespace *ns, Error **errp)
 
 
     ns->nlbaf = 8;
     ns->nlbaf = 8;
 
 
-    memcpy(&id_ns->lbaf, &lbaf, sizeof(lbaf));
+    memcpy(&id_ns->lbaf, &defaults, sizeof(defaults));
 
 
     for (i = 0; i < ns->nlbaf; i++) {
     for (i = 0; i < ns->nlbaf; i++) {
         NvmeLBAF *lbaf = &id_ns->lbaf[i];
         NvmeLBAF *lbaf = &id_ns->lbaf[i];