From: Ratheesh Kannoth <rkannoth@marvell.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Suman Ghosh <sumang@marvell.com>, <netdev@vger.kernel.org>
Subject: Re: [bug report] octeontx2-af: npc: cn20k: Use common APIs
Date: Fri, 10 Apr 2026 15:22:35 +0530 [thread overview]
Message-ID: <adjIY1Y86KbiBo3A@rkannoth-OptiPlex-7090> (raw)
In-Reply-To: <adiQJvuKlEhq2ILx@stanley.mountain>
On 2026-04-10 at 11:22:38, Dan Carpenter (error27@gmail.com) wrote:
> Hello Suman Ghosh,
>
> Commit 6d1e70282f76 ("octeontx2-af: npc: cn20k: Use common APIs")
> from Feb 24, 2026 (linux-next), leads to the following Smatch static
> checker warning:
>
> drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c:1065 npc_cn20k_config_mcam_entry()
> error: uninitialized symbol 'kw_type'.
>
> drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c
> 1045 void npc_cn20k_config_mcam_entry(struct rvu *rvu, int blkaddr, int index,
> 1046 u8 intf, struct cn20k_mcam_entry *entry,
> 1047 bool enable, u8 hw_prio, u8 req_kw_type)
> 1048 {
> 1049 struct npc_mcam *mcam = &rvu->hw->mcam;
> 1050 int mcam_idx = index % mcam->banksize;
> 1051 int bank = index / mcam->banksize;
> 1052 int kw = 0;
> 1053 u8 kw_type;
> 1054
> 1055 /* Disable before mcam entry update */
> 1056 npc_cn20k_enable_mcam_entry(rvu, blkaddr, index, false);
> 1057
> 1058 npc_mcam_idx_2_key_type(rvu, index, &kw_type);
>
> No error checking?
ACK. will push
>
> 1059 /* CAM1 takes the comparison value and
> 1060 * CAM0 specifies match for a bit in key being '0' or '1' or 'dontcare'.
> 1061 * CAM1<n> = 0 & CAM0<n> = 1 => match if key<n> = 0
> 1062 * CAM1<n> = 1 & CAM0<n> = 0 => match if key<n> = 1
> 1063 * CAM1<n> = 0 & CAM0<n> = 0 => always match i.e dontcare.
> 1064 */
> --> 1065 if (kw_type == NPC_MCAM_KEY_X2) {
> ^^^^^^^
kw_type is set by npc_mcam_idx_2_key_type() call above.
> Uninitialized
>
prev parent reply other threads:[~2026-04-10 9:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 5:52 [bug report] octeontx2-af: npc: cn20k: Use common APIs Dan Carpenter
2026-04-10 9:52 ` Ratheesh Kannoth [this message]
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=adjIY1Y86KbiBo3A@rkannoth-OptiPlex-7090 \
--to=rkannoth@marvell.com \
--cc=error27@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=sumang@marvell.com \
/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