From 449bafd130e53fc74614db75326bc0bdfb7204a6 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Fri, 23 Feb 2024 15:29:57 -0700 Subject: [PATCH] main: Remove empty switch case SDCC 4.4.0 now fails to compile if there are empty switch cases. src/board/system76/common/main.c:105: error 110: conditional flow changed by optimizer: so said EVELYN the modified DOG Signed-off-by: Tim Crawford --- src/board/system76/common/main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/board/system76/common/main.c b/src/board/system76/common/main.c index d94e9b0..4ecb438 100644 --- a/src/board/system76/common/main.c +++ b/src/board/system76/common/main.c @@ -102,6 +102,8 @@ void main(void) { uint32_t last_time_fan = 0; for (main_cycle = 0;; main_cycle++) { + // NOTE: Do note use modulo to avoid expensive call to SDCC library + // call. (Modulo is optimized for powers of 2, however.) switch (main_cycle & 3U) { case 0: // Handle USB-C events immediately before power states @@ -123,11 +125,6 @@ void main(void) { // Handle lid close/open lid_event(); break; - - case 3: - // We previously used modulo to limit when the logic for other - // cases ran, so this case is unused. - break; } if (main_cycle == 0) {