public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] octeontx2-af: npc: cn20k: Use common APIs
@ 2026-04-10  5:52 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2026-04-10  5:52 UTC (permalink / raw)
  To: Suman Ghosh; +Cc: Ratheesh Kannoth, Suman Ghosh, netdev

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-10  5:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10  5:52 [bug report] octeontx2-af: npc: cn20k: Use common APIs Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox