[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1420684386-5975-6-git-send-email-jiang.liu@linux.intel.com>
Date: Thu, 8 Jan 2015 10:32:52 +0800
From: Jiang Liu <jiang.liu@...ux.intel.com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Thomas Gleixner <tglx@...utronix.de>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Yinghai Lu <yinghai@...nel.org>,
Borislav Petkov <bp@...en8.de>,
Robert Moore <robert.moore@...el.com>,
Lv Zheng <lv.zheng@...el.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Len Brown <lenb@...nel.org>
Cc: Tony Luck <tony.luck@...el.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
linux-acpi@...r.kernel.org, Jiang Liu <jiang.liu@...ux.intel.com>,
devel@...ica.org
Subject: [RFC Patch 05/19] ACPI: Provide union for address_space64 and ext_address_space64
From: Thomas Gleixner <tglx@...utronix.de>
address_space64 and ext_address_space64 share substracts just at
different offsets. To unify the parsing functions implement the two
structs as unions of their substructs, so we can extract the shared
data.
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Jiang Liu <jiang.liu@...ux.intel.com>
---
include/acpi/acrestyp.h | 49 ++++++++++++++++++++++++++++++++++-------------
1 file changed, 36 insertions(+), 13 deletions(-)
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
index eb760ca0b2e0..307d5b2605c8 100644
--- a/include/acpi/acrestyp.h
+++ b/include/acpi/acrestyp.h
@@ -326,23 +326,46 @@ struct acpi_resource_address32 {
struct acpi_resource_source resource_source;
};
-struct acpi_resource_address64 {
- ACPI_RESOURCE_ADDRESS_COMMON u64 granularity;
- u64 minimum;
- u64 maximum;
- u64 translation_offset;
+#define ACPI_RESOURCE_ADDRESS64_COMMON \
+ u64 granularity; \
+ u64 minimum; \
+ u64 maximum; \
+ u64 translation_offset; \
u64 address_length;
- struct acpi_resource_source resource_source;
+
+struct acpi_resource_address64_common {
+ACPI_RESOURCE_ADDRESS64_COMMON};
+
+struct acpi_resource_address64 {
+ union {
+ struct {
+ ACPI_RESOURCE_ADDRESS_COMMON
+ ACPI_RESOURCE_ADDRESS64_COMMON
+ struct acpi_resource_source resource_source;
+ };
+ struct {
+ struct acpi_resource_address base;
+ struct acpi_resource_address64_common addr;
+ struct acpi_resource_source resource_source;
+ } common;
+ };
};
struct acpi_resource_extended_address64 {
- ACPI_RESOURCE_ADDRESS_COMMON u8 revision_ID;
- u64 granularity;
- u64 minimum;
- u64 maximum;
- u64 translation_offset;
- u64 address_length;
- u64 type_specific;
+ union {
+ struct {
+ ACPI_RESOURCE_ADDRESS_COMMON
+ u8 revision_ID;
+ ACPI_RESOURCE_ADDRESS64_COMMON
+ u64 type_specific;
+ };
+ struct {
+ struct acpi_resource_address base;
+ u8 revision_ID;
+ struct acpi_resource_address64_common addr;
+ u64 type_specific;
+ } common;
+ };
};
struct acpi_resource_extended_irq {
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists