]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
x86: remove dead code in intel_clk_get_rate()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 15 Feb 2020 20:22:00 +0000 (21:22 +0100)
committerBin Meng <bmeng.cn@gmail.com>
Thu, 5 Mar 2020 10:19:40 +0000 (18:19 +0800)
If all branches of a switch statement have a return instruction, all
subsequent lines are unreachable.

Identified with cppcheck.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/clk/intel/clk_intel.c

index d2e15491a3d68d631e568769df4c6223409d0a11..b633934d90a122c678c63a6f710f1b7162c1b04f 100644 (file)
@@ -11,8 +11,6 @@
 
 static ulong intel_clk_get_rate(struct clk *clk)
 {
-       ulong rate;
-
        switch (clk->id) {
        case CLK_I2C:
                /* Hard-coded to 133MHz on current platforms */
@@ -20,8 +18,6 @@ static ulong intel_clk_get_rate(struct clk *clk)
        default:
                return -ENODEV;
        }
-
-       return rate;
 }
 
 static struct clk_ops intel_clk_ops = {