[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250103155824.131285-1-niharchaithanya@gmail.com>
Date: Fri, 3 Jan 2025 21:28:26 +0530
From: Nihar Chaithanya <niharchaithanya@...il.com>
To: sgoutham@...vell.com,
gakula@...vell.com,
sbhatta@...vell.com,
hkelam@...vell.com,
andrew+netdev@...n.ch,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
sd@...asysnail.net,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: skhan@...uxfoundation.org,
Nihar Chaithanya <niharchaithanya@...il.com>
Subject: [PATCH] octeontx2-pf: mcs: Remove dead code and semi-colon from rsrc_name()
The switch-block has a default branch. Thus, the return statement at the
end of the function can never be reached. The semi-colon is not required
after switch-block.
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";.
Signed-off-by: Nihar Chaithanya <niharchaithanya@...il.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
Powered by blists - more mailing lists