From 0615ab3a2372cbc5c6a684b4a1e749b0c9224f41 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Mon, 21 Feb 2022 14:07:06 +0100 Subject: [PATCH] copy: fix enum type checking block/mars/kernel/mars_copy.c:466:2: warning: case label value is less than minimum value for type [-Wswitch-outside-range] --- kernel/mars_copy.c | 4 ++-- kernel/mars_copy.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/mars_copy.c b/kernel/mars_copy.c index 5ff1feaa..30006cad 100644 --- a/kernel/mars_copy.c +++ b/kernel/mars_copy.c @@ -434,8 +434,8 @@ int _next_state(struct copy_brick *brick, unsigned index, loff_t pos) struct mref_object *mref0; struct mref_object *mref1; struct copy_state *st; - char state; - char next_state; + enum _copy_state state; + enum _copy_state next_state; bool do_restart = false; int progress = 0; int status; diff --git a/kernel/mars_copy.h b/kernel/mars_copy.h index b62d7df1..a704f34c 100644 --- a/kernel/mars_copy.h +++ b/kernel/mars_copy.h @@ -41,7 +41,7 @@ extern int mars_copy_write_max_fly; extern atomic_t global_copy_read_flight; extern atomic_t global_copy_write_flight; -enum { +enum _copy_state { COPY_STATE_RESET = -1, COPY_STATE_START = 0, // don't change this, it _must_ be zero COPY_STATE_START2, @@ -52,12 +52,12 @@ enum { COPY_STATE_WRITTEN, COPY_STATE_CLEANUP, COPY_STATE_FINISHED, -}; +} __packed; struct copy_state { struct mref_object *table[2]; bool active[2]; - char state; + enum _copy_state state; bool writeout; short prev; unsigned short len;