2015-07-19 16:50:48

by Mathias Krause

[permalink] [raw]
Subject: [PATCH 0/2] ACPI: __refdata cleanups

This series is a respin of patch "03/12"[1] with slightly more coverage.

[1] http://marc.info/?l=linux-acpi&m=143419843716724&w=4

The __refdata annotations used to be needed in __cpuinit times but those
are long gone (since v3.11). Now those annotations may serve as an
additional error source, hiding legitimate section mismatches.

This series drops the unneeded annotations and adds a comment to the
last legitimate remaining one below drivers/acpi/.

Please apply.


Mathias Krause (2):
ACPI / processor: remove bogus __refdata annotations
ACPI / OSL: add comment for the __ref annotation of
acpi_os_unmap_iomem()

drivers/acpi/acpi_processor.c | 2 +-
drivers/acpi/osl.c | 3 +++
drivers/acpi/processor_driver.c | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)

--
1.7.10.4


2015-07-19 16:50:51

by Mathias Krause

[permalink] [raw]
Subject: [PATCH 1/2] ACPI / processor: remove bogus __refdata annotations

The processor_handler structure does not reference any __init / __exit
code or data. Therefore the __refdata annotation is not needed. It used
to be prior to commit fe7bf106ebc2 ("acpi: delete __cpuinit usage from
all acpi files") due to the __cpuinit annotation of acpi_processor_add().
But with that commit in place that requirement has gone.

The same is true for the acpi_cpu_notifier notifier block.
acpi_cpu_soft_notify() used to be marked __cpuinit but lost its
annotation in the above mentioned commit as well. Therefore the __refdata
annotation isn't needed there either.

Just drop the unneded __refdata annotations to be able to catch future
section mismatches.

Signed-off-by: Mathias Krause <[email protected]>
Cc: Paul Gortmaker <[email protected]>
---
drivers/acpi/acpi_processor.c | 2 +-
drivers/acpi/processor_driver.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
index 92a5f738e370..985b8a83184e 100644
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -485,7 +485,7 @@ static const struct acpi_device_id processor_device_ids[] = {
{ }
};

-static struct acpi_scan_handler __refdata processor_handler = {
+static struct acpi_scan_handler processor_handler = {
.ids = processor_device_ids,
.attach = acpi_processor_add,
#ifdef CONFIG_ACPI_HOTPLUG_CPU
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index d9f71581b79b..cc820d840c61 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -159,7 +159,7 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
return NOTIFY_OK;
}

-static struct notifier_block __refdata acpi_cpu_notifier = {
+static struct notifier_block acpi_cpu_notifier = {
.notifier_call = acpi_cpu_soft_notify,
};

--
1.7.10.4

2015-07-19 16:50:52

by Mathias Krause

[permalink] [raw]
Subject: [PATCH 2/2] ACPI / OSL: add comment for the __ref annotation of acpi_os_unmap_iomem()

Add a comment clarifying the need for the __ref annotation of
acpi_os_unmap_iomem(). It's safe, however, as acpi_early_init() will set
acpi_gbl_permanent_mmap to 1, disabling the problematic branch.

Signed-off-by: Mathias Krause <[email protected]>
Cc: Paul Gortmaker <[email protected]>
---
drivers/acpi/osl.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 3b8963f21b36..7e85fb84e536 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -442,6 +442,9 @@ static void acpi_os_map_cleanup(struct acpi_ioremap *map)
}
}

+/* The __ref annotation is needed as during init we may call out to
+ * __acpi_unmap_table() which is an __init annotated function.
+ */
void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size)
{
struct acpi_ioremap *map;
--
1.7.10.4