* [PATCH 1/1] x86: remove dead code in intel_clk_get_rate()
@ 2020-02-15 20:22 Heinrich Schuchardt
2020-02-16 8:49 ` Lukasz Majewski
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Heinrich Schuchardt @ 2020-02-15 20:22 UTC (permalink / raw)
To: u-boot
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>
---
drivers/clk/intel/clk_intel.c | 4 ----
1 file changed, 4 deletions(-)
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 = {
--
2.25.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 1/1] x86: remove dead code in intel_clk_get_rate()
2020-02-15 20:22 [PATCH 1/1] x86: remove dead code in intel_clk_get_rate() Heinrich Schuchardt
@ 2020-02-16 8:49 ` Lukasz Majewski
2020-02-16 19:03 ` Simon Glass
2020-02-20 13:40 ` Bin Meng
2 siblings, 0 replies; 4+ messages in thread
From: Lukasz Majewski @ 2020-02-16 8:49 UTC (permalink / raw)
To: u-boot
On Sat, 15 Feb 2020 21:22:00 +0100
Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> 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>
> ---
> drivers/clk/intel/clk_intel.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> 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 = {
> --
> 2.25.0
>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200216/04d7158d/attachment.sig>
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 1/1] x86: remove dead code in intel_clk_get_rate()
2020-02-15 20:22 [PATCH 1/1] x86: remove dead code in intel_clk_get_rate() Heinrich Schuchardt
2020-02-16 8:49 ` Lukasz Majewski
@ 2020-02-16 19:03 ` Simon Glass
2020-02-20 13:40 ` Bin Meng
2 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2020-02-16 19:03 UTC (permalink / raw)
To: u-boot
On Sat, 15 Feb 2020 at 13:22, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> 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>
> ---
> drivers/clk/intel/clk_intel.c | 4 ----
> 1 file changed, 4 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] x86: remove dead code in intel_clk_get_rate()
2020-02-15 20:22 [PATCH 1/1] x86: remove dead code in intel_clk_get_rate() Heinrich Schuchardt
2020-02-16 8:49 ` Lukasz Majewski
2020-02-16 19:03 ` Simon Glass
@ 2020-02-20 13:40 ` Bin Meng
2 siblings, 0 replies; 4+ messages in thread
From: Bin Meng @ 2020-02-20 13:40 UTC (permalink / raw)
To: u-boot
On Sun, Feb 16, 2020 at 4:22 AM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> 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>
> ---
> drivers/clk/intel/clk_intel.c | 4 ----
> 1 file changed, 4 deletions(-)
>
applied to u-boot-x86, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-02-20 13:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-15 20:22 [PATCH 1/1] x86: remove dead code in intel_clk_get_rate() Heinrich Schuchardt
2020-02-16 8:49 ` Lukasz Majewski
2020-02-16 19:03 ` Simon Glass
2020-02-20 13:40 ` Bin Meng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox