Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1152771pxb; Tue, 17 Aug 2021 05:13:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOWVwIPdUV5dRNLArSp1MEJnSrzGMcyQdjYF9XtrU9aUegnOQHhA30NLQWWjf3LaYn8RCx X-Received: by 2002:a17:906:fc16:: with SMTP id ov22mr3632656ejb.45.1629202436742; Tue, 17 Aug 2021 05:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629202436; cv=none; d=google.com; s=arc-20160816; b=Yv5IdperPTPdkK89pIq48stKCeEdK7FgNkyR8Dftxjn3O61vmVSexremkSbq/UiSyR Q9NqqMU30LhSuypczP1cbD/ZAaMtN9qwEndfm0OWS1mKJvYWTnSbp6b/aprJbSGZyP7J WZ6u7hMcqq7yLVBjP7GWcIrRgJYS6ek/6s2dhJgJpMt+hPg8uCahkrd5+MD0WkxbSyPi 2X2N/38Z2/y+mshvThZRcbLX5m2un/2yd9IG+g2BfWgORx2xPnVkPgtReD1wfxr7YCJu B6zLuHT9qHwLx12wr271irVtIs/EWPw0/niXY1TWJVG1sdDeU6Wz6rPnqB12u2jlOUFH za6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=nFz0Nr8OXTUP1nQxg0bJBftwgKHV9xouBoIxk7Nh48Y=; b=VoPKu13FU9NnjvW4FxfkWwoMxDJcxLQZeq5BqfTDVtLEzBKY121yupOEGjx6Hkm/Ob VLT96PDvD3IOcYercoHSjMoMPTj4pPADUIFfhRhHZEpiyEmC8P8LTsz8vdQysC1kP2+F O8L6AMC5cJ5i2CZ21IzRMUx/Svit+zjwzvCpFaCq1dAdejyZ7ZokEebBMigjR1hZhdVt b6GMJ6qRBefF6JCYe4DnTfrL1KxpAGtpsSTgROOYd5nslm8M8H88sjoVKReY0YU/GyRt kiJXHgalO7uACWAW83y7Grmj3Yz8zoFUKeP/IGK/8bAYu1yHotAAIotSpw6nIH/Qa+r0 EMQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s4si2069579eji.269.2021.08.17.05.13.30; Tue, 17 Aug 2021 05:13:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237125AbhHQMMc (ORCPT + 99 others); Tue, 17 Aug 2021 08:12:32 -0400 Received: from smtpbg604.qq.com ([59.36.128.82]:59974 "EHLO smtpbg604.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236113AbhHQMMb (ORCPT ); Tue, 17 Aug 2021 08:12:31 -0400 X-QQ-mid: bizesmtp38t1629202296t33kylxn Received: from localhost.localdomain (unknown [125.69.42.50]) by esmtp6.qq.com (ESMTP) with id ; Tue, 17 Aug 2021 20:11:35 +0800 (CST) X-QQ-SSF: 01000000004000B0C000B00A0000000 X-QQ-FEAT: OE6UcXCtsg2bsgZj0W0I+9riVp875uiNWEuV337EZEK3Xw6RepVlVn0F8+Wdi apwT6OtZlsFDGiBbGiFZcOxMuyl41G66klyqcrJxUV8qvuUCxVnOvr5h59aYUE8XNTv+ZvL Iun9dS+YT6hSTRdsYaEG6/bS19Da5pO5vBce+YgDsx+H5+fC/2JPHKWVkZMU2EfKeV0Vpnq Yp4LKHmDic7e/chLEVHERGIx9mtruNn0wy/WuXfRWQl4Dk8248m5F0cw0Tf0U3k1VM3JJIh VM6FUn+boif0wq4e+cCZ7uQJDMpysaXEAIEl5LoFfSZVG8XbvR2I69TJ5XS7Dbv6pFB4z6+ Nyoz3hwFIwTmQ5wgK8ROmMdU60yDQ== X-QQ-GoodBg: 0 From: Jason Wang To: kuba@kernel.org Cc: davem@davemloft.net, tariqt@nvidia.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Jason Wang Subject: [PATCH] net/mlx4: Use ARRAY_SIZE to get an array's size Date: Tue, 17 Aug 2021 20:11:06 +0800 Message-Id: <20210817121106.44189-1-wangborong@cdjrlc.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:cdjrlc.com:qybgspam:qybgspam4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 2584bc038f94..b149e601f673 100644 --- a/drivers/net/ethernet/mellanox/mlx4/qp.c +++ b/drivers/net/ethernet/mellanox/mlx4/qp.c @@ -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++) { struct mlx4_bitmap *bitmap = mlx4_zone_get_bitmap(qp_table->zones, -- 2.32.0