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
Date: Sun, 13 Nov 2022 17:50:30 +0800 (GMT+08:00) [thread overview]
Message-ID: <3701ca18.12f.1847065cd7e.Coremail.wangkailong@jari.cn> (raw)
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 <wangkailong@jari.cn>
---
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
next reply other threads:[~2022-11-13 9:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-13 9:50 wangkailong [this message]
2022-11-14 15:30 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3701ca18.12f.1847065cd7e.Coremail.wangkailong@jari.cn \
--to=wangkailong@jari.cn \
--cc=devel@acpica.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=robert.moore@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®