From: Willy Tarreau Date: Thu, 6 Jun 2019 14:38:40 +0000 (+0200) Subject: BUILD: stream-int: avoid a build warning in dev mode in si_state_bit() X-Git-Tag: v2.0-dev6~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad660e3f84c24435b9f883416568415819f137fa;p=thirdparty%2Fhaproxy.git BUILD: stream-int: avoid a build warning in dev mode in si_state_bit() The BUG_ON() test emits a warning about an always-true comparison regarding which cannot be lower than zero. Let's get rid of it. --- diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h index 29eda6bc62..50373ac720 100644 --- a/include/proto/stream_interface.h +++ b/include/proto/stream_interface.h @@ -143,7 +143,7 @@ static inline void si_set_state(struct stream_interface *si, int state) /* returns a bit for a stream-int state, to match against SI_SB_* */ static inline enum si_state_bit si_state_bit(enum si_state state) { - BUG_ON(state < SI_ST_INI || state > SI_ST_CLO); + BUG_ON(state > SI_ST_CLO); return 1U << state; }