linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mlx4: Use of macro ARRAY_SIZE() to calculate array size
@ 2025-06-19 12:47 Qianfeng Rong
  0 siblings, 0 replies; only message in thread
From: Qianfeng Rong @ 2025-06-19 12:47 UTC (permalink / raw)
  To: Tariq Toukan, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-rdma, linux-kernel
  Cc: opensource.kernel, Qianfeng Rong

Use of macro ARRAY_SIZE to calculate array size minimizes
the redundant code and improves code reusability.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-06-19 12:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-19 12:47 [PATCH] mlx4: Use of macro ARRAY_SIZE() to calculate array size Qianfeng Rong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).