Skip to content

Commit

Permalink
Fix compilation warnings under gcc 9.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
huaicheng committed Apr 22, 2022
1 parent 9f5123c commit a73620b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions hw/femu/nvme.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 13 additions & 0 deletions hw/femu/zns/zns.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit a73620b

Please sign in to comment.