diff mbox series

[3/3] net/can/dev: Remove dead code

Message ID 20241221035352.1020228-4-ariel.otilibili-anieli@eurecom.fr (mailing list archive)
State New
Headers show
Series broadcom, ethernet/marvell,cx231xx,can/dev: Remove unused values and dead code | expand

Commit Message

Ariel Otilibili Dec. 21, 2024, 3:44 a.m. UTC
The default switch case ends with a return; meaning this return is never reached.

Coverity-ID: 1497123
Signed-off-by: Ariel Otilibili <ariel.otilibili-anieli@eurecom.fr>
---
 drivers/net/can/dev/dev.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Andrew Lunn Dec. 21, 2024, 3:20 p.m. UTC | #1
On Sat, Dec 21, 2024 at 04:44:17AM +0100, Ariel Otilibili wrote:
> The default switch case ends with a return; meaning this return is never reached.

Not quite correct. It is the fact that all the case statement,
including the default, make a return, which makes this last return
unreachable.

    Andrew

---
pw-bot: cr
diff mbox series

Patch

diff --git a/drivers/net/can/dev/dev.c b/drivers/net/can/dev/dev.c
index 681643ab3780..5ec3170b896a 100644
--- a/drivers/net/can/dev/dev.c
+++ b/drivers/net/can/dev/dev.c
@@ -85,8 +85,6 @@  const char *can_get_state_str(const enum can_state state)
 	default:
 		return "<unknown>";
 	}
-
-	return "<unknown>";
 }
 EXPORT_SYMBOL_GPL(can_get_state_str);