From nobody Mon Feb 9 21:11:55 2026 Received: from canpmsgout02.his.huawei.com (canpmsgout02.his.huawei.com [113.46.200.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 988B444CF3A; Tue, 20 Jan 2026 14:30:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.217 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919410; cv=none; b=K+XEAFU+gz22aqWaGa1YfmEGwkCVStJyBLXTCQMSVRBKNEeTZ0WUpmzB+qIjSNtYX2U3+doVHtMt8PMyLLBScvcxX3zkr3nQHXHNbvv21kdI2yLrp0HKI/mscVDiCTW9T6uqeMCrZuyvGNDkSttBq5lxVtbnt2P5efvzOadV+kQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768919410; c=relaxed/simple; bh=EABVssCM123G7jWb1K2EzG7DAOvkk0hnvjBy1LCXY/0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=I9Ez4yfSE8dUW7ZbpWDzVy0wfqz0GBh4iwqccsKh8c1Xc3AATg6uDNefs/PgobWHVPE/4YJUGl88Ro36A8oft7O/B7b0B3WCWunTcH/QgY3qiWxTFvYh8OszIweAc8l1NVQodYHsYQ/zcbGkfb+S4MAIwxiAV1Uf0DZ8WOATBmE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=pFH6JFXL; arc=none smtp.client-ip=113.46.200.217 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="pFH6JFXL" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=RyoonJga84J5TYM1qUcca+lnnVeYd8lqRPR77Y61Dr4=; b=pFH6JFXLbQyoXthbYVtnz8XH05nCtt8/a74b8NqgOmA90cMyIz71b1r684czZpqvGBTqii1gw EwJT6JaTFJUWUDxgaSf1e1NybnJQos/F8513ZI0oGkqz2qtv4KwI2v6VtbBasEwh68HEcD/2BUk 07caBsoVuxLI1MLC5DEUvhk= Received: from mail.maildlp.com (unknown [172.19.162.140]) by canpmsgout02.his.huawei.com (SkyGuard) with ESMTPS id 4dwV4J60p6zcbPb; Tue, 20 Jan 2026 22:26:08 +0800 (CST) Received: from kwepemf100013.china.huawei.com (unknown [7.202.181.12]) by mail.maildlp.com (Postfix) with ESMTPS id 9D40F20104; Tue, 20 Jan 2026 22:30:04 +0800 (CST) Received: from DESKTOP-62GVMTR.china.huawei.com (10.174.188.120) by kwepemf100013.china.huawei.com (7.202.181.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Tue, 20 Jan 2026 22:30:03 +0800 From: Fan Gong To: Fan Gong , Zhu Yikai , , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn CC: , , luosifu , Xin Guo , Zhou Shuai , Wu Like , Shi Jing , Luo Yang Subject: [PATCH net-next v01 4/5] hinic3: Use array_size instead of multiplying Date: Tue, 20 Jan 2026 22:29:50 +0800 Message-ID: X-Mailer: git-send-email 2.51.0.windows.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemf100013.china.huawei.com (7.202.181.12) Content-Type: text/plain; charset="utf-8" According to comment of patch 03, check codes that were merged and use array_size instead of multiplying. Co-developed-by: Zhu Yikai Signed-off-by: Zhu Yikai Signed-off-by: Fan Gong --- drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c b/drivers/= net/ethernet/huawei/hinic3/hinic3_nic_cfg.c index b6cc7bb7bb0c..44abccf9cb29 100644 --- a/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c @@ -23,7 +23,8 @@ static int hinic3_feature_nego(struct hinic3_hwdev *hwdev= , u8 opcode, feature_nego.func_id =3D hinic3_global_func_id(hwdev); feature_nego.opcode =3D opcode; if (opcode =3D=3D MGMT_MSG_CMD_OP_SET) - memcpy(feature_nego.s_feature, s_feature, size * sizeof(u64)); + memcpy(feature_nego.s_feature, s_feature, + array_size(size, sizeof(u64))); =20 mgmt_msg_params_init_default(&msg_params, &feature_nego, sizeof(feature_nego)); @@ -37,7 +38,8 @@ static int hinic3_feature_nego(struct hinic3_hwdev *hwdev= , u8 opcode, } =20 if (opcode =3D=3D MGMT_MSG_CMD_OP_GET) - memcpy(s_feature, feature_nego.s_feature, size * sizeof(u64)); + memcpy(s_feature, feature_nego.s_feature, + array_size(size, sizeof(u64))); =20 return 0; } --=20 2.43.0