Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp373293ybe; Wed, 4 Sep 2019 00:45:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJKrEK04IWTHWachEArHaQEDvNeWgs1Gh2gy/e0WL0NU1WFJWw/RF9ScMljlStToSjHPRB X-Received: by 2002:a17:902:8345:: with SMTP id z5mr41003310pln.29.1567583102146; Wed, 04 Sep 2019 00:45:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567583102; cv=none; d=google.com; s=arc-20160816; b=JrtL6Y9Vnyq8lEPcWsmGvnv88XgjP94oSvbcx3aUiAGB1Z9xQMTLPxlOf+uWVu8LNA cMTmilRq/aZrARadhAnnlZvPhR06k81f+KoVqu8myDYHBuKhHZSL6GSWbvEK+wbxHPyI /Gc4inabSY6aNVlJflf462TZ3hXXjRrJm5Cy2LSQBxryE4MFUKqJ/mrEzrmlw13qmWkK w+jGTnS+25Uiu8mp+hmbA5w4yRtEaGZjSFRFntA7I/BkzoSH9UVcXjwYkW/dxIewb7ud wk7lDMVADiOBC7DulH+lDUWkA1y3bIIvY9QS8nvnsPSKl0IBvhOJFOPUpXu0leebXfB4 iLSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=KOZcB1Gqm0XXfBinGHAMaBkx8IHOtqFI7y7HUQsCWPg=; b=WXYQttGW9fh7MtykOfQ5tcyTHKXCZyVx0lZKDcliIWGP3HIiqvQybngTy00kEcfefn O8N/8p1wmpcsWKSja6q87plKctwEUcAjQiO9J9SxKqpRUpmwSYRRuSbGNSbgjSrleu+Q 7aciUg1vHh8vbWVQv/z3gAb/dU6zJXFY2KFq8+bPPXCKTTsP8yeEYsH74yeEzksCQtgz eykUH8HIASqbMetFf59BKoiwyXkOH3qgwquKiFR6z9fH+TyL7xCh8iANHpsAI8IBXs3Z m1esBqPcMevwALjyYpV6r7smz6QSpPFPG+dgja9hU4ukOAUm6ojV9/qXB8+QLY5Y/kY2 3yrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 12si16668883pgu.469.2019.09.04.00.44.38; Wed, 04 Sep 2019 00:45:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729026AbfIDHo0 (ORCPT + 99 others); Wed, 4 Sep 2019 03:44:26 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6201 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725267AbfIDHo0 (ORCPT ); Wed, 4 Sep 2019 03:44:26 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D60405E7619FEC6AE1FE; Wed, 4 Sep 2019 15:44:20 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Wed, 4 Sep 2019 15:44:13 +0800 From: zhong jiang To: , CC: , , , , Subject: [PATCH] ath10k: Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element Date: Wed, 4 Sep 2019 15:41:18 +0800 Message-ID: <1567582878-18739-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org With the help of Coccinelle, ARRAY_SIZE can be replaced in ath10k_snoc_wlan_enable. Signed-off-by: zhong jiang --- drivers/net/wireless/ath/ath10k/snoc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index b491361..49fc044 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -976,8 +976,7 @@ static int ath10k_snoc_wlan_enable(struct ath10k *ar, sizeof(struct ath10k_svc_pipe_cfg); cfg.ce_svc_cfg = (struct ath10k_svc_pipe_cfg *) &target_service_to_ce_map_wlan; - cfg.num_shadow_reg_cfg = sizeof(target_shadow_reg_cfg_map) / - sizeof(struct ath10k_shadow_reg_cfg); + cfg.num_shadow_reg_cfg = ARRAY_SIZE(target_shadow_reg_cfg_map); cfg.shadow_reg_cfg = (struct ath10k_shadow_reg_cfg *) &target_shadow_reg_cfg_map; -- 1.7.12.4