Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5666208rwb; Mon, 14 Nov 2022 07:53:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf6GAQcY8QDyrfmRPn/VJUTr+dmGlNO+e/ji1XCgZwB+lsOtmjlBZqe1r6vCIH1+eFEkUtMF X-Received: by 2002:a17:907:7853:b0:78d:ee08:1867 with SMTP id lb19-20020a170907785300b0078dee081867mr11336213ejc.123.1668441193178; Mon, 14 Nov 2022 07:53:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668441193; cv=none; d=google.com; s=arc-20160816; b=F6NHgm+1VGqjNgKD/7U1t3EmE0zGHuzF9P8JSC4ULg7pAAeWBxpdjzyY3brKRDyuBK C1L+SB7qqiYbSxD+HjaJTLypO2DgeHjy6++CCLOjLXHdKAIa/34QZPP2Lh6bcWkBUvZ2 hf/HK0Fh1JdoDW9PJVlhFrugI0JIDKPMmIJKYfsppMhiOV/Hw3+35pyGP5mIYW/74wQd n8RHpSxH/1c7MMoLG/FMPyJw7Zo02VXqkHeRZi2OBlbDhbNr4A+KQpIset6JXxxuJZkV zLh5QY7lkCM/elSJ1DtPh39j8C8hT1Vk42Gb4mQeNNpxl5izbJlR+ylQBcJ3jjNGBMVt jj7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=h99OlI5BbKbsPyp3lQEwfF/aB86+nXeBTZxW/Q0PKWg=; b=0LzsUwy57eeSfnx6F860p/kebc7ScC8jYGMjQY7XCsPscjFau5vfDRfFeQnl5M3SPV d6a0AlsFxYT5bS73H3Tb0UiHdxdaP63n0GY2XPdOAIyV551Ua7jSpa5wO1RbmhjQPBEz xq0KrZU+7PYZuGScEOECj/mObR88q9w3p8KfUhLDy5gU8N6xORHh/B48jcK0cQPJozx2 I45vvYnzBoiycsahe7E4eR8GikdrNiXLr9cXyJcOMK+5fhSD3YN2xwBrj/ebc+r5topT pWSq8GHUMIkRaGmSS/RYfGbUyEjEsWSc2xHT39qC67kY/AKu5l4eDTbpyanteYAJoZjl fjaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r16-20020a05640251d000b004677a9c4b39si7238002edd.91.2022.11.14.07.52.50; Mon, 14 Nov 2022 07:53:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236638AbiKNPal (ORCPT + 88 others); Mon, 14 Nov 2022 10:30:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236205AbiKNPaj (ORCPT ); Mon, 14 Nov 2022 10:30:39 -0500 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CB0D14D17; Mon, 14 Nov 2022 07:30:38 -0800 (PST) Received: by mail-qk1-f179.google.com with SMTP id k2so7585028qkk.7; Mon, 14 Nov 2022 07:30:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=h99OlI5BbKbsPyp3lQEwfF/aB86+nXeBTZxW/Q0PKWg=; b=SsO8ug6Rvjx5h0LpBBfnCwqbFrPpL5+BGjGPrrpVv8pKxXoZvkTTh9JiUgzLgA6GtW 3hpaPVg0H7OcHIrsbpyAR1lM+7lluZArfdJBWBkzVttcPd8G7yXuvY3czVRmNrzWmhrU G+BhLWF+HJ23t1ETWZNQ8iNwtuKjnVekiJhpNax9R2OohWgoY9gMjF6t863iEvQE+W8M NxnDOgKqujuYr97Z9t8UYILrEHv5+EGnlcbdk9IvCNy+kEXZXgq9HU6vpT5coGHtgoba drASF487i7ALSZdcihiLTQjs/STyZ7CAhqU0x0Z0h5oj34imH2BB4btEpJxSVd7TTLp2 jv8Q== X-Gm-Message-State: ANoB5plsba5C0bGx2qL99GvsOiufXyTm/8sGLvrLjk1IR3DPu2gkZw30 w4UK8AHoGUEVKJ/mU+ajkYVXqcHG6agEMnyG5Mc= X-Received: by 2002:a37:638f:0:b0:6ec:fa04:d97c with SMTP id x137-20020a37638f000000b006ecfa04d97cmr11105446qkb.764.1668439837750; Mon, 14 Nov 2022 07:30:37 -0800 (PST) MIME-Version: 1.0 References: <3701ca18.12f.1847065cd7e.Coremail.wangkailong@jari.cn> In-Reply-To: <3701ca18.12f.1847065cd7e.Coremail.wangkailong@jari.cn> From: "Rafael J. Wysocki" Date: Mon, 14 Nov 2022 16:30:20 +0100 Message-ID: Subject: Re: [PATCH] ACPICA: fix array_size.cocci warning To: wangkailong@jari.cn Cc: robert.moore@intel.com, rafael.j.wysocki@intel.com, lenb@kernel.org, linux-acpi@vger.kernel.org, devel@acpica.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 13, 2022 at 10:55 AM wrote: > > Fix following coccicheck warning: > > drivers/acpi/acpica/tbfadt.c:107:27-28: WARNING: Use ARRAY_SIZE > drivers/acpi/acpica/tbfadt.c:137:30-31: WARNING: Use ARRAY_SIZE > > Signed-off-by: KaiLong Wang Please submit ACPICA changes to the upstream project on GitHub. If they are not applicable there, they are also not applicable to the Linux kernel. > --- > drivers/acpi/acpica/tbfadt.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c > index 31d7ea84a360..637fcd74f30e 100644 > --- a/drivers/acpi/acpica/tbfadt.c > +++ b/drivers/acpi/acpica/tbfadt.c > @@ -103,9 +103,7 @@ static struct acpi_fadt_info fadt_info_table[] = { > ACPI_FADT_SEPARATE_LENGTH | ACPI_FADT_GPE_REGISTER} > }; > > -#define ACPI_FADT_INFO_ENTRIES \ > - (sizeof (fadt_info_table) / sizeof (struct acpi_fadt_info)) > - > +#define ACPI_FADT_INFO_ENTRIES (ARRAY_SIZE(fadt_info_table)) > /* Table used to split Event Blocks into separate status/enable registers */ > > typedef struct acpi_fadt_pm_info { > @@ -133,9 +131,7 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = { > 1} > }; > > -#define ACPI_FADT_PM_INFO_ENTRIES \ > - (sizeof (fadt_pm_info_table) / sizeof (struct acpi_fadt_pm_info)) > - > +#define ACPI_FADT_PM_INFO_ENTRIES (ARRAY_SIZE(fadt_pm_info_table)) > /******************************************************************************* > * > * FUNCTION: acpi_tb_init_generic_address > -- > 2.25.1