From patchwork Sun Nov 13 09:50:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiLong Wang X-Patchwork-Id: 19320 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1620132wru; Sun, 13 Nov 2022 02:04:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf59vgosjZB4iGaRLGxVsiMUUZvaylML4e8lAvY4l04IoYbszMYcsFPYVfenra/WdIhuiKvt X-Received: by 2002:a17:902:daca:b0:17a:a81:2a52 with SMTP id q10-20020a170902daca00b0017a0a812a52mr9312163plx.159.1668333897854; Sun, 13 Nov 2022 02:04:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668333897; cv=none; d=google.com; s=arc-20160816; b=kHwHGED04u/Q4OYpAKnY7Za4KO3dpP7EedvprsAyomgCLCNwRVX8Rgtqiws07ggNH4 cnFo6jI4bqGQf6tLkXUxKQ2VhocIDOzmm0wvOv7VadNJrk3lepiqU9vkYg/Ixa9luAIR fvGGzJIkLc7dmUsrDojzKgA9pqivUPLzUhwWLfzlXSjHiWgcryC1LHTq8UvZU7NAo0hC gZwb6VOa7GfQhtLAvOInp5xIty25Ev4gc85tFs4xhvtQdYcVL9SUmoRXMo2SHkWsfIIp 9iJ6VOER6OWJ0uJEtS/AvaijqsMvA9AGyi0aFodhD2hhmrx27nW7uDyX24FkWZ2bCLZ2 aiAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date; bh=pCHJTOWbsnd/UePszIat1+y/N6O4NSDjsq51g9XBxus=; b=d5uf6it399CjXPwC/fD/ohEmtGMSEWy4+93dVexEy01Yw7mSSTLCvj3ygGlIHvl9uL V2t63YBmWAbqn3Ajxpn65l1a4rW3kXcY3/Ob53raYTUJY95OXiab3J/2KWGpT6J0wV6n eZCfeBHyr3BUUfpGSrFD4Jc9oem3VZDOrEvSg5u+u8XPC1F6+h/f2Yu+XFsEwnmj3OSy 7ycv76IStioP3WFlsIPR3N4LVVWV5qEoR0gpfE9nuKv0uJ+F97NrB6/5W8J+Zgdhru++ Al0aYZO8XcRvVij6pUTr1ROWumAwS2bkYhYt6T+csoUvI61Pl27Ge5PlT9Xx6cMMWpwa JggQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k35-20020a17090a14a600b00212f7abe85csi10633975pja.41.2022.11.13.02.04.43; Sun, 13 Nov 2022 02:04:57 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235097AbiKMJzn (ORCPT + 99 others); Sun, 13 Nov 2022 04:55:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229753AbiKMJzk (ORCPT ); Sun, 13 Nov 2022 04:55:40 -0500 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C7B23E009; Sun, 13 Nov 2022 01:55:39 -0800 (PST) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Sun, 13 Nov 2022 17:50:30 +0800 (GMT+08:00) X-Originating-IP: [182.148.14.167] Date: Sun, 13 Nov 2022 17:50:30 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: wangkailong@jari.cn To: robert.moore@intel.com, rafael.j.wysocki@intel.com, lenb@kernel.org Cc: linux-acpi@vger.kernel.org, devel@acpica.org, linux-kernel@vger.kernel.org Subject: [PATCH] ACPICA: fix array_size.cocci warning X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT6.0.1 build 20210329(c53f3fee) Copyright (c) 2002-2022 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn MIME-Version: 1.0 Message-ID: <3701ca18.12f.1847065cd7e.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwD3C+LmvXBj4BsDAA--.83W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQAEB2FEYx0DfwAZs8 X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00,RCVD_IN_PBL,RDNS_NONE, T_SPF_HELO_PERMERROR,T_SPF_PERMERROR,XPRIO autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749374885671521407?= X-GMAIL-MSGID: =?utf-8?q?1749374885671521407?= 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 --- 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