From c1122f17d6848c250c805a0c68031310a3d56a3f Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 23 Jun 2017 12:43:31 +0200 Subject: [PATCH] control_cmd.c: Fix unsiged comparison against < 0 Fixes following warning: control_cmd.c:294:16: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare] if (cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) { Change-Id: I3df8a4f646222337927d9e3cac6d09a8a05cb20c --- src/ctrl/control_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index 836bb7179..24b388b30 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -291,7 +291,7 @@ struct ctrl_cmd *ctrl_cmd_parse(void *ctx, struct msgb *msg) } cmd->type = get_string_value(ctrl_type_vals, tmp); - if (cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) { + if ((int)cmd->type < 0 || cmd->type == CTRL_TYPE_UNKNOWN) { cmd->type = CTRL_TYPE_ERROR; cmd->id = "err"; cmd->reply = "Request type unknown";