From: Nihar Chaithanya <niharchaithanya@gmail.com>
To: sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com,
hkelam@marvell.com, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
sd@queasysnail.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: skhan@linuxfoundation.org, Nihar Chaithanya <niharchaithanya@gmail.com>
Subject: [PATCH] octeontx2-pf: mcs: Remove dead code and semi-colon from rsrc_name()
Date: Fri, 3 Jan 2025 21:28:26 +0530 [thread overview]
Message-ID: <20250103155824.131285-1-niharchaithanya@gmail.com> (raw)
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@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
next reply other threads:[~2025-01-03 15:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-03 15:58 Nihar Chaithanya [this message]
2025-01-03 16:36 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250103155824.131285-1-niharchaithanya@gmail.com \
--to=niharchaithanya@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sbhatta@marvell.com \
--cc=sd@queasysnail.net \
--cc=sgoutham@marvell.com \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®