[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250619124746.175934-1-rongqianfeng@vivo.com>
Date: Thu, 19 Jun 2025 20:47:46 +0800
From: Qianfeng Rong <rongqianfeng@...o.com>
To: Tariq Toukan <tariqt@...dia.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org,
linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com,
Qianfeng Rong <rongqianfeng@...o.com>
Subject: [PATCH] mlx4: Use of macro ARRAY_SIZE() to calculate array size
Use of macro ARRAY_SIZE to calculate array size minimizes
the redundant code and improves code reusability.
Signed-off-by: Qianfeng Rong <rongqianfeng@...o.com>
---
drivers/net/ethernet/mellanox/mlx4/qp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/qp.c b/drivers/net/ethernet/mellanox/mlx4/qp.c
index 913ed255990f..c2c837187c29 100644
--- a/drivers/net/ethernet/mellanox/mlx4/qp.c
+++ b/drivers/net/ethernet/mellanox/mlx4/qp.c
@@ -617,7 +617,7 @@ static int mlx4_create_zones(struct mlx4_dev *dev,
* and A0 steering area size) are such that there are only two subareas -- one
* for RSS and one for RAW_ETH.
*/
- for (k = MLX4_QP_TABLE_ZONE_RSS + 1; k < sizeof(*bitmap)/sizeof((*bitmap)[0]);
+ for (k = MLX4_QP_TABLE_ZONE_RSS + 1; k < ARRAY_SIZE((*bitmap));
k++) {
int size;
u32 offset = start_offset_rss;
--
2.34.1
Powered by blists - more mailing lists