From e3a582202fc2cb076dc385154548af05756ae9bc Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 30 Oct 2017 13:02:06 +0100 Subject: [PATCH] wifi: refactor nm_wifi_utils_level_to_quality() not to assert Apparantly, the assert might fail (on i386?). Unclear why that would possibly happen. Anyway, replace the assert. --- src/devices/wifi/nm-wifi-utils.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/devices/wifi/nm-wifi-utils.c b/src/devices/wifi/nm-wifi-utils.c index 06da92cecd..3ff82004d0 100644 --- a/src/devices/wifi/nm-wifi-utils.c +++ b/src/devices/wifi/nm-wifi-utils.c @@ -777,10 +777,8 @@ nm_wifi_utils_level_to_quality (gint val) val = 100 - (int) ((100.0 * (double) val) / 60.0); } else { /* Assume signal is a "quality" percentage */ - val = CLAMP (val, 0, 100); } - g_assert (val >= 0); - return (guint32) val; + return CLAMP (val, 0, 100); }