From patchwork Fri Feb 11 15:55:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hariprasad Kelam X-Patchwork-Id: 12743597 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88310C433EF for ; Fri, 11 Feb 2022 15:55:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349429AbiBKPzw (ORCPT ); Fri, 11 Feb 2022 10:55:52 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:32856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240763AbiBKPzv (ORCPT ); Fri, 11 Feb 2022 10:55:51 -0500 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C02D196; Fri, 11 Feb 2022 07:55:50 -0800 (PST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 21B7wbaT013056; Fri, 11 Feb 2022 07:55:45 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0220; bh=dWr+tSglDx+SxNcNWkY4QkhK2Es0TIOHiTqTfSn34L0=; b=TqJfnbO0dOKYNaX8TG4T/yllxqWoENzSU2JDZjstt3+0ph2Y8OpO1o2F6rgoONtcgLht eBaa2MkRGHiRLcnYXwph05ejp3dlNyi7Zu449WOnzcedGkLxta6i/Gue3Wz3Atmzb0+a 0NVHyGM/gRGR1WWeLER8VySVjj3FCxwU3q6cC7e6XZKERNnpADfgMQxX8jt8LlMAeDg9 Iq+m/QyMIDn59gCu0eIACjBWLf0EDzs83D3xGgV1sJhh+mLYX/k1cFds1mEDqmbqeW5w QO+Fhf0cbsNWFGhMNfQQ0u+2M4iJ61nPntlk1l6RgKRzZxy4u6Rx5rwLcxiWs55CaTqM IA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3e5134e98j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 11 Feb 2022 07:55:45 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 11 Feb 2022 07:55:43 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Fri, 11 Feb 2022 07:55:43 -0800 Received: from hyd1soter3.marvell.com (unknown [10.29.37.12]) by maili.marvell.com (Postfix) with ESMTP id BF4683F7043; Fri, 11 Feb 2022 07:55:40 -0800 (PST) From: Hariprasad Kelam To: , CC: , , , , , , , Subject: [net-next PATCH V2] octeontx2-af: fix array bound error Date: Fri, 11 Feb 2022 21:25:39 +0530 Message-ID: <20220211155539.13931-1-hkelam@marvell.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Proofpoint-GUID: nUI8qYgSoa5e5qqkpw3uMI-KRDppvV40 X-Proofpoint-ORIG-GUID: nUI8qYgSoa5e5qqkpw3uMI-KRDppvV40 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-11_05,2022-02-11_01,2021-12-02_01 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch fixes below error by using proper data type. drivers/net/ethernet/marvell/octeontx2/af/rpm.c: In function 'rpm_cfg_pfc_quanta_thresh': include/linux/find.h:40:23: error: array subscript 'long unsigned int[0]' is partly outside array bounds of 'u16[1]' {aka 'short unsigned int[1]'} [-Werror=array-bounds] 40 | val = *addr & GENMASK(size - 1, offset); Reported-by: Stephen Rothwell Signed-off-by: Hariprasad Kelam --- v2 * add Reported-by tag drivers/net/ethernet/marvell/octeontx2/af/rpm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rpm.c b/drivers/net/ethernet/marvell/octeontx2/af/rpm.c index d7a8aad46e12..47e83d7a5804 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rpm.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rpm.c @@ -141,14 +141,15 @@ int rpm_lmac_get_pause_frm_status(void *rpmd, int lmac_id, return 0; } -static void rpm_cfg_pfc_quanta_thresh(rpm_t *rpm, int lmac_id, u16 pfc_en, +static void rpm_cfg_pfc_quanta_thresh(rpm_t *rpm, int lmac_id, + unsigned long pfc_en, bool enable) { u64 quanta_offset = 0, quanta_thresh = 0, cfg; int i, shift; /* Set pause time and interval */ - for_each_set_bit(i, (unsigned long *)&pfc_en, 16) { + for_each_set_bit(i, &pfc_en, 16) { switch (i) { case 0: case 1: