Skip to content

Commit 698a82e

Browse files
Subbaraya Sundeepdavem330
authored andcommitted
octeontx2-af: Fix static code analyzer reported issues
This patch fixes the static code analyzer reported issues in rvu_npc.c. The reported errors are different sizes of operands in bitops and returning uninitialized values. Fixes: 651cd26 ("octeontx2-af: MCAM entry installation support") Signed-off-by: Subbaraya Sundeep <[email protected]> Signed-off-by: Sunil Goutham <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f2e4568 commit 698a82e

File tree

1 file changed

+3
-3
lines changed
  • drivers/net/ethernet/marvell/octeontx2/af

1 file changed

+3
-3
lines changed

drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#define RSVD_MCAM_ENTRIES_PER_NIXLF 1 /* Ucast for LFs */
2121

2222
#define NPC_PARSE_RESULT_DMAC_OFFSET 8
23-
#define NPC_HW_TSTAMP_OFFSET 8
23+
#define NPC_HW_TSTAMP_OFFSET 8ULL
2424
#define NPC_KEX_CHAN_MASK 0xFFFULL
2525
#define NPC_KEX_PF_FUNC_MASK 0xFFFFULL
2626

@@ -2154,7 +2154,7 @@ static void npc_unmap_mcam_entry_and_cntr(struct rvu *rvu,
21542154
int blkaddr, u16 entry, u16 cntr)
21552155
{
21562156
u16 index = entry & (mcam->banksize - 1);
2157-
u16 bank = npc_get_bank(mcam, entry);
2157+
u32 bank = npc_get_bank(mcam, entry);
21582158

21592159
/* Remove mapping and reduce counter's refcnt */
21602160
mcam->entry2cntr_map[entry] = NPC_MCAM_INVALID_MAP;
@@ -2777,8 +2777,8 @@ int rvu_mbox_handler_npc_mcam_shift_entry(struct rvu *rvu,
27772777
struct npc_mcam *mcam = &rvu->hw->mcam;
27782778
u16 pcifunc = req->hdr.pcifunc;
27792779
u16 old_entry, new_entry;
2780+
int blkaddr, rc = 0;
27802781
u16 index, cntr;
2781-
int blkaddr, rc;
27822782

27832783
blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);
27842784
if (blkaddr < 0)

0 commit comments

Comments
 (0)