]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
clk/sophgo: Using BUG() instead of unreachable() in mmux_get_parent_id()
authorLi Qiang <liqiang01@kylinos.cn>
Tue, 9 Jul 2024 06:36:38 +0000 (14:36 +0800)
committerStephen Boyd <sboyd@kernel.org>
Wed, 10 Jul 2024 21:15:54 +0000 (14:15 -0700)
In general it's a good idea to avoid using bare unreachable() because it
introduces undefined behavior in compiled code. but it caused a compilation warning,
Using BUG() instead of unreachable() to resolve compilation warnings.

Fixes the following warnings:
    drivers/clk/sophgo/clk-cv18xx-ip.o: warning: objtool: mmux_round_rate() falls through to next function bypass_div_round_rate()

Fixes: 80fd61ec46124 ("clk: sophgo: Add clock support for CV1800 SoC")
Signed-off-by: Li Qiang <liqiang01@kylinos.cn>
Link: https://lore.kernel.org/r/c8e66d51f880127549e2a3e623be6787f62b310d.1720506143.git.liqiang01@kylinos.cn
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/sophgo/clk-cv18xx-ip.c

index 805f561725ae159e216ef31bfd644de59fb6c58f..b186e64d4813e2701b17520e544c453fc13d0e77 100644 (file)
@@ -613,7 +613,7 @@ static u8 mmux_get_parent_id(struct cv1800_clk_mmux *mmux)
                        return i;
        }
 
-       unreachable();
+       BUG();
 }
 
 static int mmux_enable(struct clk_hw *hw)