From: Heinrich Schuchardt Date: Sat, 15 Feb 2020 20:22:00 +0000 (+0100) Subject: x86: remove dead code in intel_clk_get_rate() X-Git-Tag: v2020.04-rc4~22^2~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=38a2a48cd9e4697cb8942e56212610d4248ea34c;p=oweals%2Fu-boot.git x86: remove dead code in intel_clk_get_rate() If all branches of a switch statement have a return instruction, all subsequent lines are unreachable. Identified with cppcheck. Signed-off-by: Heinrich Schuchardt Reviewed-by: Lukasz Majewski Reviewed-by: Simon Glass --- diff --git a/drivers/clk/intel/clk_intel.c b/drivers/clk/intel/clk_intel.c index d2e15491a3..b633934d90 100644 --- a/drivers/clk/intel/clk_intel.c +++ b/drivers/clk/intel/clk_intel.c @@ -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 = {