[dm-devel] [PATCH V2 1/5] multipathd: adopt static char* arr in daemon_status

Martin Wilck mwilck at suse.com
Fri Aug 21 13:42:02 UTC 2020


On Fri, 2020-08-21 at 18:58 +0800, Zhiqiang Liu wrote:
> We adopt static char* array (demon_status_msg) in daemon_status func,
> so it looks more simpler and easier to expand.
> 
> V1->V2:
> - use "int" as the type of "status" (suggested by Martin)
> 
> Signed-off-by: Zhiqiang Liu <liuzhiqiang26 at huawei.com>
> Signed-off-by: lixiaokeng <lixiaokeng at huawei.com>
> ---
>  multipathd/main.c | 30 +++++++++++++++---------------
>  multipathd/main.h |  3 ++-
>  2 files changed, 17 insertions(+), 16 deletions(-)
> 
> diff --git a/multipathd/main.c b/multipathd/main.c
> index 9ec65856..62cf4ff4 100644
> --- a/multipathd/main.c
> +++ b/multipathd/main.c
> diff --git a/multipathd/main.h b/multipathd/main.h
> index 5dff17e5..6a5592c0 100644
> --- a/multipathd/main.h
> +++ b/multipathd/main.h
> @@ -4,12 +4,13 @@
>  #define MAPGCINT 5
> 
>  enum daemon_status {
> -	DAEMON_INIT,
> +	DAEMON_INIT = 0,
>  	DAEMON_START,
>  	DAEMON_CONFIGURE,
>  	DAEMON_IDLE,
>  	DAEMON_RUNNING,
>  	DAEMON_SHUTDOWN,
> +	DAEMON_STATUS_SIZE,
>  };

This breaks compilation:

main.c: In function ‘sd_notify_status’:
main.c:184:2: error: enumeration value ‘DAEMON_STATUS_SIZE’ not handled
in switch [-Werror=switch]
  switch (state) {
  ^~~~~~

Please avoid introducing DAEMON_STATUS_SIZE.

This would be fixed by your patch 2 because it removes the switch
statement, but no patch in a series should break compilation, to 
allow future bisections.

I have to withdraw my "Reviewed-by: for the time being, sorry.

Martin


> 
>  struct prout_param_descriptor;






More information about the dm-devel mailing list