* [PATCH v2] octeontx2-pf: mcs: Remove dead code and semi-colon from rsrc_name()
@ 2025-01-04 17:19 Nihar Chaithanya
2025-01-07 1:00 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Nihar Chaithanya @ 2025-01-04 17:19 UTC (permalink / raw)
To: sgoutham, gakula, sbhatta, hkelam, andrew+netdev, davem, edumazet,
kuba, pabeni, sd, netdev, linux-kernel
Cc: skhan, Nihar Chaithanya
Every case in the switch-block ends with return statement, and the
default: branch handles the cases where rsrc_type is invalid and
returns "Unknown", this makes the return statement at the end of the
function unreachable and redundant.
The semi-colon is not required after the switch-block's curly braces.
Remove the semi-colon after the switch-block's curly braces and the
return statement at the end of the function.
This issue was reported by Coverity Scan.
Report:
CID 1516236: (#1 of 1): Structurally dead code (UNREACHABLE)
unreachable: This code cannot be reached: return "Unknown";.
Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
v2:
- Changed the commit message to better explain why the code is not
reachable.
v1: https://lore.kernel.org/all/20250103155824.131285-1-niharchaithanya@gmail.com/
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
index 6cc7a78968fc..f3b9daffaec3 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
@@ -133,9 +133,7 @@ static const char *rsrc_name(enum mcs_rsrc_type rsrc_type)
return "SA";
default:
return "Unknown";
- };
-
- return "Unknown";
+ }
}
static int cn10k_mcs_alloc_rsrc(struct otx2_nic *pfvf, enum mcs_direction dir,
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] octeontx2-pf: mcs: Remove dead code and semi-colon from rsrc_name()
2025-01-04 17:19 [PATCH v2] octeontx2-pf: mcs: Remove dead code and semi-colon from rsrc_name() Nihar Chaithanya
@ 2025-01-07 1:00 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-01-07 1:00 UTC (permalink / raw)
To: Nihar Chaithanya
Cc: sgoutham, gakula, sbhatta, hkelam, andrew+netdev, davem, edumazet,
kuba, pabeni, sd, netdev, linux-kernel, skhan
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 4 Jan 2025 22:49:15 +0530 you wrote:
> Every case in the switch-block ends with return statement, and the
> default: branch handles the cases where rsrc_type is invalid and
> returns "Unknown", this makes the return statement at the end of the
> function unreachable and redundant.
> The semi-colon is not required after the switch-block's curly braces.
>
> Remove the semi-colon after the switch-block's curly braces and the
> return statement at the end of the function.
>
> [...]
Here is the summary with links:
- [v2] octeontx2-pf: mcs: Remove dead code and semi-colon from rsrc_name()
https://git.kernel.org/netdev/net-next/c/49afc040f4d7
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-07 1:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-04 17:19 [PATCH v2] octeontx2-pf: mcs: Remove dead code and semi-colon from rsrc_name() Nihar Chaithanya
2025-01-07 1:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).