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 <[email protected]>
---
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
On Sun, Nov 13, 2022 at 10:55 AM <[email protected]> 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 <[email protected]>
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