Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp105252pxb; Mon, 13 Sep 2021 14:14:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi69QngiUdbSG6kgigKhSarq3FY7bW3K22UCfsqdAajI5C92np58iZsVscnvs9/Q7+Nrhj X-Received: by 2002:a17:906:6148:: with SMTP id p8mr14601753ejl.17.1631567647279; Mon, 13 Sep 2021 14:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631567647; cv=none; d=google.com; s=arc-20160816; b=loZvhTneZmIhEd++cB9FZmPmD6FUDPBlXGqoPVUrkE+zqvv1uN2s/q02cnR4THCBlw Tfg/kJUwwQJlUi9UfSJzNku9lFdqDQysslXMDYQ1L2WI+Kog4bxHJPjmL6y4T5byiD4f VnKVCtkK/PxZ3AR0DYIda9v2qrlcCIhI79GWvcnNbhu+G3VamGCm/PJEuO6wJarHvtLS 9O98MRxXK0KPgm82wvKOr2tz8i/p3QjwnUvE2qpaPo+o64kosqaldpDSTzKcUBcsJEJv qUAadbRpJ1ykRgrC17hJz5gXmp3F8JiJ2ZvTfGO0z2Gr1QTcIjxonOezYDhhEfM707Xp wu6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ilQn1cGCImUIY40DYjemyzz5S7m/+6lWw8d65LvvR6o=; b=MJngDrBMGqot/a+OSRghS1aOuLEUxVn5IvtaHPnHPnafQSM9vJcCuZPPfac1mqWH3d a+qxOTxdtvjcMXmYCNxModP80X/hUYW1ll9dPiKcNxPuNmQSJCt71FZTJmZY59s+5+pk 4AotNMv1kGWnUgpM9jsQUn9XUkG70gDthoLs0yO9Oj5mEB6hrLU0HMXGNHX9hFcZnZFO cbllVEHsctkfyqK4EcPyKu+aC+HV3e/srz+1xA8oLJr+kge49mXgTDLKe1j9lKp4o7c5 NBE/ptpp57zF+lXZzpVXB1h1hjieojyFI80LxxLtiRj9RROUyjIwsjYa2zjCDxC+yvIE 4rWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2DPscJqf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz14si7430511ejc.306.2021.09.13.14.13.43; Mon, 13 Sep 2021 14:14:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2DPscJqf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244429AbhIMNxN (ORCPT + 99 others); Mon, 13 Sep 2021 09:53:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:56762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244526AbhIMNtd (ORCPT ); Mon, 13 Sep 2021 09:49:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF5FD6152B; Mon, 13 Sep 2021 13:33:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539993; bh=lzVwAXKN3WGnht6ENogvCiF5d2VbewTF7MCfwouzSps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2DPscJqfEupnJGbE6QRTUEnazo9gPy4CWgsI3iJIcqNwG/HwXJMzfWMkfINqwFBuP MgP+j4GaMBPZgXdl0zYYa9gIrtvqrwZRoOXsv6psdRQ7UVZu+Tm9Qn3neScMBGeVKJ hifngnmBKi3weNrvFPicuc/evH3uYsAldVFqGaO4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Subbaraya Sundeep , Sunil Goutham , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 212/236] octeontx2-af: Fix static code analyzer reported issues Date: Mon, 13 Sep 2021 15:15:17 +0200 Message-Id: <20210913131107.587604223@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Subbaraya Sundeep [ Upstream commit 698a82ebfb4b2f2014baf31b7324b328a2a6366e ] 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: 651cd2652339 ("octeontx2-af: MCAM entry installation support") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index 7767b1111944..a8a515ba1700 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c @@ -27,7 +27,7 @@ #define NIXLF_PROMISC_ENTRY 2 #define NPC_PARSE_RESULT_DMAC_OFFSET 8 -#define NPC_HW_TSTAMP_OFFSET 8 +#define NPC_HW_TSTAMP_OFFSET 8ULL static const char def_pfl_name[] = "default"; @@ -1318,7 +1318,7 @@ static void npc_unmap_mcam_entry_and_cntr(struct rvu *rvu, int blkaddr, u16 entry, u16 cntr) { 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 */ mcam->entry2cntr_map[entry] = NPC_MCAM_INVALID_MAP; @@ -1879,8 +1879,8 @@ int rvu_mbox_handler_npc_mcam_shift_entry(struct rvu *rvu, struct npc_mcam *mcam = &rvu->hw->mcam; u16 pcifunc = req->hdr.pcifunc; u16 old_entry, new_entry; + int blkaddr, rc = 0; u16 index, cntr; - int blkaddr, rc; blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0); if (blkaddr < 0) -- 2.30.2