Commit 698a82eb authored by Subbaraya Sundeep's avatar Subbaraya Sundeep Committed by David S. Miller

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: 651cd265 ("octeontx2-af: MCAM entry installation support")
Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f2e4568e
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#define RSVD_MCAM_ENTRIES_PER_NIXLF 1 /* Ucast for LFs */ #define RSVD_MCAM_ENTRIES_PER_NIXLF 1 /* Ucast for LFs */
#define NPC_PARSE_RESULT_DMAC_OFFSET 8 #define NPC_PARSE_RESULT_DMAC_OFFSET 8
#define NPC_HW_TSTAMP_OFFSET 8 #define NPC_HW_TSTAMP_OFFSET 8ULL
#define NPC_KEX_CHAN_MASK 0xFFFULL #define NPC_KEX_CHAN_MASK 0xFFFULL
#define NPC_KEX_PF_FUNC_MASK 0xFFFFULL #define NPC_KEX_PF_FUNC_MASK 0xFFFFULL
...@@ -2154,7 +2154,7 @@ static void npc_unmap_mcam_entry_and_cntr(struct rvu *rvu, ...@@ -2154,7 +2154,7 @@ static void npc_unmap_mcam_entry_and_cntr(struct rvu *rvu,
int blkaddr, u16 entry, u16 cntr) int blkaddr, u16 entry, u16 cntr)
{ {
u16 index = entry & (mcam->banksize - 1); u16 index = entry & (mcam->banksize - 1);
u16 bank = npc_get_bank(mcam, entry); u32 bank = npc_get_bank(mcam, entry);
/* Remove mapping and reduce counter's refcnt */ /* Remove mapping and reduce counter's refcnt */
mcam->entry2cntr_map[entry] = NPC_MCAM_INVALID_MAP; mcam->entry2cntr_map[entry] = NPC_MCAM_INVALID_MAP;
...@@ -2777,8 +2777,8 @@ int rvu_mbox_handler_npc_mcam_shift_entry(struct rvu *rvu, ...@@ -2777,8 +2777,8 @@ int rvu_mbox_handler_npc_mcam_shift_entry(struct rvu *rvu,
struct npc_mcam *mcam = &rvu->hw->mcam; struct npc_mcam *mcam = &rvu->hw->mcam;
u16 pcifunc = req->hdr.pcifunc; u16 pcifunc = req->hdr.pcifunc;
u16 old_entry, new_entry; u16 old_entry, new_entry;
int blkaddr, rc = 0;
u16 index, cntr; u16 index, cntr;
int blkaddr, rc;
blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);
if (blkaddr < 0) if (blkaddr < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment