From a73620bf8f2453aa76a810a6847ef9ac481c315b Mon Sep 17 00:00:00 2001 From: Huaicheng Li Date: Fri, 22 Apr 2022 01:50:21 -0500 Subject: [PATCH] Fix compilation warnings under gcc 9.4.0 --- hw/femu/nvme.h | 1 + hw/femu/zns/zns.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/hw/femu/nvme.h b/hw/femu/nvme.h index adacd2b8a00..1b4f681cd0b 100644 --- a/hw/femu/nvme.h +++ b/hw/femu/nvme.h @@ -5,6 +5,7 @@ #include "qemu/uuid.h" #include "qemu/units.h" #include "qemu/cutils.h" +#include "qemu/memalign.h" #include "hw/pci/msix.h" #include "hw/pci/msi.h" #include "hw/virtio/vhost.h" diff --git a/hw/femu/zns/zns.c b/hw/femu/zns/zns.c index 8fdf1a22a59..d970c0e61fa 100644 --- a/hw/femu/zns/zns.c +++ b/hw/femu/zns/zns.c @@ -506,10 +506,13 @@ static void zns_aio_zone_reset_cb(NvmeRequest *req, NvmeZone *zone) /* FIXME, We always assume reset SUCCESS */ switch (zns_get_zone_state(zone)) { case NVME_ZONE_STATE_EXPLICITLY_OPEN: + /* fall through */ case NVME_ZONE_STATE_IMPLICITLY_OPEN: zns_aor_dec_open(ns); + /* fall through */ case NVME_ZONE_STATE_CLOSED: zns_aor_dec_active(ns); + /* fall through */ case NVME_ZONE_STATE_FULL: zone->w_ptr = zone->d.zslba; zone->d.wp = zone->w_ptr; @@ -542,6 +545,7 @@ static uint16_t zns_open_zone(NvmeNamespace *ns, NvmeZone *zone, return status; } zns_aor_inc_active(ns); + /* fall through */ case NVME_ZONE_STATE_CLOSED: status = zns_aor_check(ns, 0, 1); if (status != NVME_SUCCESS) { @@ -551,8 +555,10 @@ static uint16_t zns_open_zone(NvmeNamespace *ns, NvmeZone *zone, return status; } zns_aor_inc_open(ns); + /* fall through */ case NVME_ZONE_STATE_IMPLICITLY_OPEN: zns_assign_zone_state(ns, zone, NVME_ZONE_STATE_EXPLICITLY_OPEN); + /* fall through */ case NVME_ZONE_STATE_EXPLICITLY_OPEN: return NVME_SUCCESS; default: @@ -565,9 +571,11 @@ static uint16_t zns_close_zone(NvmeNamespace *ns, NvmeZone *zone, { switch (state) { case NVME_ZONE_STATE_EXPLICITLY_OPEN: + /* fall through */ case NVME_ZONE_STATE_IMPLICITLY_OPEN: zns_aor_dec_open(ns); zns_assign_zone_state(ns, zone, NVME_ZONE_STATE_CLOSED); + /* fall through */ case NVME_ZONE_STATE_CLOSED: return NVME_SUCCESS; default: @@ -580,14 +588,18 @@ static uint16_t zns_finish_zone(NvmeNamespace *ns, NvmeZone *zone, { switch (state) { case NVME_ZONE_STATE_EXPLICITLY_OPEN: + /* fall through */ case NVME_ZONE_STATE_IMPLICITLY_OPEN: zns_aor_dec_open(ns); + /* fall through */ case NVME_ZONE_STATE_CLOSED: zns_aor_dec_active(ns); + /* fall through */ case NVME_ZONE_STATE_EMPTY: zone->w_ptr = zns_zone_wr_boundary(zone); zone->d.wp = zone->w_ptr; zns_assign_zone_state(ns, zone, NVME_ZONE_STATE_FULL); + /* fall through */ case NVME_ZONE_STATE_FULL: return NVME_SUCCESS; default: @@ -621,6 +633,7 @@ static uint16_t zns_offline_zone(NvmeNamespace *ns, NvmeZone *zone, switch (state) { case NVME_ZONE_STATE_READ_ONLY: zns_assign_zone_state(ns, zone, NVME_ZONE_STATE_OFFLINE); + /* fall through */ case NVME_ZONE_STATE_OFFLINE: return NVME_SUCCESS; default: