From: Thiago Farina <tfransosi@gmail.com>
To: trivial@kernel.org
Cc: lenb@kernel.org, ming.m.lin@intel.com, robert.moore@intel.com,
jkosina@suze.cz, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, Thiago Farina <tfransosi@gmail.com>
Subject: [PATCH] trivial: remove ACPI_ARRAY_LENGTH macro.
Date: Sun, 1 Nov 2009 17:36:12 -0500 [thread overview]
Message-ID: <1257114972-16039-1-git-send-email-tfransosi@gmail.com> (raw)
Since the kernel already has a macro (ARRAY_SIZE) that does the same thing,
just use it instead of defining another macro for the same propose.
Signed-off-by: Thiago Farina <tfransosi@gmail.com>
---
drivers/acpi/acpica/hwvalid.c | 2 +-
drivers/acpi/acpica/uteval.c | 4 ++--
include/acpi/actypes.h | 4 ----
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/acpi/acpica/hwvalid.c b/drivers/acpi/acpica/hwvalid.c
index ec33f27..ca2eb02 100644
--- a/drivers/acpi/acpica/hwvalid.c
+++ b/drivers/acpi/acpica/hwvalid.c
@@ -103,7 +103,7 @@ static const struct acpi_port_info acpi_protected_ports[] = {
{"PCI", 0x0CF8, 0x0CFF, ACPI_OSI_WIN_XP}
};
-#define ACPI_PORT_INFO_ENTRIES ACPI_ARRAY_LENGTH (acpi_protected_ports)
+#define ACPI_PORT_INFO_ENTRIES ARRAY_SIZE(acpi_protected_ports)
/******************************************************************************
*
diff --git a/drivers/acpi/acpica/uteval.c b/drivers/acpi/acpica/uteval.c
index 5d54e36..54efbaa 100644
--- a/drivers/acpi/acpica/uteval.c
+++ b/drivers/acpi/acpica/uteval.c
@@ -126,7 +126,7 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
/* Compare input string to static table of supported interfaces */
- for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) {
+ for (i = 0; i < ARRAY_SIZE(acpi_interfaces_supported); i++) {
if (!ACPI_STRCMP(string_desc->string.pointer,
acpi_interfaces_supported[i].name)) {
/*
@@ -186,7 +186,7 @@ acpi_status acpi_osi_invalidate(char *interface)
{
int i;
- for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) {
+ for (i = 0; i < ARRAY_SIZE(acpi_interfaces_supported); i++) {
if (!ACPI_STRCMP(interface, acpi_interfaces_supported[i].name)) {
*acpi_interfaces_supported[i].name = '\0';
return AE_OK;
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 153f12d..641d746 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -441,10 +441,6 @@ typedef unsigned long long acpi_integer;
#define ACPI_MIN(a,b) (((a)<(b))?(a):(b))
#define ACPI_MAX(a,b) (((a)>(b))?(a):(b))
-/* Size calculation */
-
-#define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
-
/* Pointer manipulation */
#define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p))
--
1.6.5.1.61.ge79999
next reply other threads:[~2009-11-01 22:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-01 22:36 Thiago Farina [this message]
2009-11-02 16:49 ` Bjorn Helgaas
2009-11-02 21:35 ` Moore, Robert
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=1257114972-16039-1-git-send-email-tfransosi@gmail.com \
--to=tfransosi@gmail.com \
--cc=jkosina@suze.cz \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.m.lin@intel.com \
--cc=robert.moore@intel.com \
--cc=trivial@kernel.org \
/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®