From bc05f4b750897bbb05cd1fbcc53d5bdfc1933a60 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 1 Jun 2021 17:39:25 +0200 Subject: [PATCH] core: avoid lgtm warning in _sleep_duration_convert_ms_to_us() return x < G_MAXULONG ? (gulong) x : G_MAXULONG; ^^^ Comparison is always true because x <= 4294967295000. --- src/core/nm-core-utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c index bae9c336e6..f6690846d3 100644 --- a/src/core/nm-core-utils.c +++ b/src/core/nm-core-utils.c @@ -587,7 +587,8 @@ _sleep_duration_convert_ms_to_us(guint32 sleep_duration_msec) if (sleep_duration_msec > 0) { guint64 x = ((guint64) sleep_duration_msec) * 1000UL; - return x < G_MAXULONG ? (gulong) x : G_MAXULONG; + nm_assert(x < G_MAXULONG); + return x; } return G_USEC_PER_SEC / 20; }