From: Dan Carpenter <error27@gmail.com>
To: Suman Ghosh <sumang@marvell.com>
Cc: Ratheesh Kannoth <rkannoth@marvell.com>,
Suman Ghosh <sumang@marvell.com>,
netdev@vger.kernel.org
Subject: [bug report] octeontx2-af: npc: cn20k: Use common APIs
Date: Fri, 10 Apr 2026 08:52:38 +0300 [thread overview]
Message-ID: <adiQJvuKlEhq2ILx@stanley.mountain> (raw)
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?
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) {
^^^^^^^
Uninitialized
1066 /* Clear mcam entry to avoid writes being suppressed by NPC */
1067 npc_cn20k_clear_mcam_entry(rvu, blkaddr, bank, mcam_idx);
1068 npc_cn20k_config_kw_x2(rvu, mcam, blkaddr,
This email is a free service from the Smatch-CI project [smatch.sf.net].
regards,
dan carpenter
next reply other threads:[~2026-04-10 5:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 5:52 Dan Carpenter [this message]
2026-04-10 9:52 ` [bug report] octeontx2-af: npc: cn20k: Use common APIs Ratheesh Kannoth
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=adiQJvuKlEhq2ILx@stanley.mountain \
--to=error27@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=rkannoth@marvell.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.