All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations
@ 2007-05-26 10:39 ` Andi Drebes
  0 siblings, 0 replies; 26+ messages in thread
From: Andi Drebes @ 2007-05-26 10:39 UTC (permalink / raw)
  To: kernel-janitors, lenb; +Cc: linux-acpi

This patch replaces lines in the acpi subsystem that use
sizeof/sizeof to determine the size of an array with the
ARRAY_SIZE(x) macro.

Signed-off-by: Andi Drebes <lists-receive@programmierforen.de>
---
Compile tested with allyesconfig on i386.
Diffed against Linus' git-tree.


diff --git a/drivers/acpi/resources/rsdump.c b/drivers/acpi/resources/rsdump.c
index 46da116..7b8e12d 100644
--- a/drivers/acpi/resources/rsdump.c
+++ b/drivers/acpi/resources/rsdump.c
@@ -76,7 +76,7 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table);
 
 #define ACPI_RSD_OFFSET(f)          (u8) ACPI_OFFSET (union acpi_resource_data,f)
 #define ACPI_PRT_OFFSET(f)          (u8) ACPI_OFFSET (struct acpi_pci_routing_table,f)
-#define ACPI_RSD_TABLE_SIZE(name)   (sizeof(name) / sizeof (struct acpi_rsdump_info))
+#define ACPI_RSD_TABLE_SIZE(name)   (ARRAY_SIZE(name))
 
 /*******************************************************************************
  *
diff --git a/drivers/acpi/tables/tbfadt.c b/drivers/acpi/tables/tbfadt.c
index 1285e91..4d59de2 100644
--- a/drivers/acpi/tables/tbfadt.c
+++ b/drivers/acpi/tables/tbfadt.c
@@ -104,7 +104,7 @@ static struct acpi_fadt_info fadt_info_table[] = {
 	 ACPI_FADT_OFFSET(gpe1_block_length), ACPI_FADT_SEPARATE_LENGTH}
 };
 
-#define ACPI_FADT_INFO_ENTRIES        (sizeof (fadt_info_table) / sizeof (struct acpi_fadt_info))
+#define ACPI_FADT_INFO_ENTRIES        (ARRAY_SIZE(fadt_info_table))
 
 /*******************************************************************************
  *
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2007-06-15 17:57 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-26 10:39 [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations Andi Drebes
2007-05-26 10:39 ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations replaced with ARRAY_SIZE Andi Drebes
2007-05-26 11:28 ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations Robert P. J. Day
2007-05-26 11:28   ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations replaced with ARRAY_SIZE Robert P. J. Day
2007-05-26 13:53   ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations Andi Drebes
2007-05-26 13:53     ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations replaced with ARRAY_SIZE Andi Drebes
2007-05-26 11:37 ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations Richard Knutsson
2007-05-26 11:37   ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations replaced with ARRAY_SIZE Richard Knutsson
2007-05-26 13:58   ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations Andi Drebes
2007-05-26 13:58     ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations replaced with ARRAY_SIZE Andi Drebes
2007-05-30 19:25     ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations Len Brown
2007-05-30 19:25       ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations replaced with ARRAY_SIZE Len Brown
2007-05-31  9:56       ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations Christoph Hellwig
2007-05-31  9:56         ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations replaced with ARRAY_SIZE Christoph Hellwig
2007-06-10 10:57         ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations Pavel Machek
2007-06-10 10:57           ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations replaced with ARRAY_SIZE Pavel Machek
2007-06-10 21:44           ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations Bjorn Helgaas
2007-06-10 21:44             ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations replaced with ARRAY_SIZE Bjorn Helgaas
2007-06-12 18:41             ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations Andi Drebes
2007-06-12 18:41               ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations replaced with ARRAY_SIZE Andi Drebes
2007-06-12 18:53               ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations Bjorn Helgaas
2007-06-12 18:53                 ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations replaced with ARRAY_SIZE Bjorn Helgaas
2007-06-13 21:21                 ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations Andi Drebes
2007-06-13 21:21                   ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations replaced with ARRAY_SIZE Andi Drebes
2007-06-15 17:56                 ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations Andi Drebes
2007-06-15 17:56                   ` [KJ] [PATCH] drivers/acpi: sizeof/sizeof array size calculations replaced with ARRAY_SIZE Andi Drebes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.