From: Jason Wang <hidden> Date: 2021-08-17 12:12:03
The ARRAY_SIZE macro is defined to get an array's size which is
more compact and more formal in linux source. Thus, we can replace
the long sizeof(arr)/sizeof(arr[0]) with the compact ARRAY_SIZE.
Signed-off-by: Jason Wang <redacted>
---
drivers/net/ethernet/mellanox/mlx4/qp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Joe Perches <joe@perches.com> Date: 2021-08-18 00:39:25
On Tue, 2021-08-17 at 20:11 +0800, Jason Wang wrote:
The ARRAY_SIZE macro is defined to get an array's size which is
more compact and more formal in linux source. Thus, we can replace
the long sizeof(arr)/sizeof(arr[0]) with the compact ARRAY_SIZE.
On Tue, 2021-08-17 at 20:11 +0800, Jason Wang wrote:
quoted
The ARRAY_SIZE macro is defined to get an array's size which is
more compact and more formal in linux source. Thus, we can replace
the long sizeof(arr)/sizeof(arr[0]) with the compact ARRAY_SIZE.
@@ -739,7 +739,7 @@ static void mlx4_cleanup_qp_zones(struct mlx4_dev *dev) int i; for (i = 0;- i < sizeof(qp_table->zones_uids)/sizeof(qp_table->zones_uids[0]);+ i < ARRAY_SIZE(qp_table->zones_uids); i++) {
trivia: could now be a single line
for (i = 0; i < ARRAY_SIZE(qp_table->zones_uids); i++) {
I'm fine with both suggestions.
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Thanks for your patch.
Tariq
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Tue, 17 Aug 2021 20:11:06 +0800 you wrote:
The ARRAY_SIZE macro is defined to get an array's size which is
more compact and more formal in linux source. Thus, we can replace
the long sizeof(arr)/sizeof(arr[0]) with the compact ARRAY_SIZE.
Signed-off-by: Jason Wang <redacted>
---
drivers/net/ethernet/mellanox/mlx4/qp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)