From: Eero Tamminen Date: Wed, 17 Jan 2024 15:28:07 +0000 (+0200) Subject: write_riemann_threshold.c: fix switch-case fall through warning X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3917%2Fhead;p=thirdparty%2Fcollectd.git write_riemann_threshold.c: fix switch-case fall through warning Checking also warning limits was just executing redundant code, but otherwise harmless as later code checks failure count first. Signed-off-by: Eero Tamminen --- diff --git a/src/write_riemann_threshold.c b/src/write_riemann_threshold.c index 9968c4451..54a7e5bd3 100644 --- a/src/write_riemann_threshold.c +++ b/src/write_riemann_threshold.c @@ -83,16 +83,16 @@ static int ut_check_one_data_source( (!isnan(th->failure_max) && ((th->failure_max - th->hysteresis) > values[ds_index]))) return STATE_OKAY; - else - is_failure++; + is_failure++; + break; case STATE_WARNING: if ((!isnan(th->warning_min) && ((th->warning_min + th->hysteresis) < values[ds_index])) || (!isnan(th->warning_max) && ((th->warning_max - th->hysteresis) > values[ds_index]))) return STATE_OKAY; - else - is_warning++; + is_warning++; + break; } } else { /* no hysteresis */ if ((!isnan(th->failure_min) && (th->failure_min > values[ds_index])) ||