From 8b62740472c4fe3cee64df4588033e1d8ff3b235 Mon Sep 17 00:00:00 2001 From: Jason Yan Date: Sat, 12 Sep 2020 11:38:51 +0800 Subject: ACPI, APEI: make apei_resources_all static This eliminates the following sparse warning: drivers/acpi/apei/apei-base.c:290:23: warning: symbol 'apei_resources_all' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Jason Yan Reviewed-by: Borislav Petkov Signed-off-by: Rafael J. Wysocki --- drivers/acpi/apei/apei-base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c index e358d0046494..d3fbac58d91a 100644 --- a/drivers/acpi/apei/apei-base.c +++ b/drivers/acpi/apei/apei-base.c @@ -287,7 +287,7 @@ struct apei_res { }; /* Collect all resources requested, to avoid conflict */ -struct apei_resources apei_resources_all = { +static struct apei_resources apei_resources_all = { .iomem = LIST_HEAD_INIT(apei_resources_all.iomem), .ioport = LIST_HEAD_INIT(apei_resources_all.ioport), }; -- cgit v1.2.3 From eb37ba316fdec9c6af36b8b155732568c5b2a2d4 Mon Sep 17 00:00:00 2001 From: Hanjun Guo Date: Fri, 13 Nov 2020 10:08:44 +0800 Subject: ACPI: processor: Remove the duplicated ACPI_PROCESSOR_CLASS macro The ACPI_PROCESSOR_CLASS macro is defined in , and ACPI drivers for processor already included , so we can remove those duplicated ACPI_PROCESSOR_CLASS macros. Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki --- drivers/acpi/processor_idle.c | 1 - drivers/acpi/processor_perflib.c | 1 - drivers/acpi/processor_thermal.c | 2 -- drivers/acpi/processor_throttling.c | 1 - 4 files changed, 5 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index f66236cff69b..d93e400940a3 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -31,7 +31,6 @@ #include #endif -#define ACPI_PROCESSOR_CLASS "processor" #define _COMPONENT ACPI_PROCESSOR_COMPONENT ACPI_MODULE_NAME("processor_idle"); diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index b04a68950ff1..3b5a9646b49d 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c @@ -22,7 +22,6 @@ #define PREFIX "ACPI: " -#define ACPI_PROCESSOR_CLASS "processor" #define ACPI_PROCESSOR_FILE_PERFORMANCE "performance" #define _COMPONENT ACPI_PROCESSOR_COMPONENT ACPI_MODULE_NAME("processor_perflib"); diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c index 6c7d05b37c98..677a132be242 100644 --- a/drivers/acpi/processor_thermal.c +++ b/drivers/acpi/processor_thermal.c @@ -19,8 +19,6 @@ #define PREFIX "ACPI: " -#define ACPI_PROCESSOR_CLASS "processor" - #ifdef CONFIG_CPU_FREQ /* If a passive cooling situation is detected, primarily CPUfreq is used, as it diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index a0bd56ece3ff..b1876534324b 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -22,7 +22,6 @@ #define PREFIX "ACPI: " -#define ACPI_PROCESSOR_CLASS "processor" #define _COMPONENT ACPI_PROCESSOR_COMPONENT ACPI_MODULE_NAME("processor_throttling"); -- cgit v1.2.3 From ab5369bba5189f44538bef07943f323992fe964e Mon Sep 17 00:00:00 2001 From: Hanjun Guo Date: Fri, 13 Nov 2020 10:20:29 +0800 Subject: ACPI: debug: Remove the not used function The inline function __acpi_aml_opened() is not used anywhere, remove it. Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_dbg.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpi_dbg.c b/drivers/acpi/acpi_dbg.c index fb7290338593..d50261d05f3a 100644 --- a/drivers/acpi/acpi_dbg.c +++ b/drivers/acpi/acpi_dbg.c @@ -117,13 +117,6 @@ static inline bool __acpi_aml_busy(void) return false; } -static inline bool __acpi_aml_opened(void) -{ - if (acpi_aml_io.flags & ACPI_AML_OPEN) - return true; - return false; -} - static inline bool __acpi_aml_used(void) { return acpi_aml_io.usages ? true : false; -- cgit v1.2.3 From dff714087c40644d225094a1f75d2272cc8a4885 Mon Sep 17 00:00:00 2001 From: Hanjun Guo Date: Fri, 13 Nov 2020 10:25:10 +0800 Subject: ACPI: SBS: Simplify the driver init code acpi_bus_register_driver() will check acpi_disable and return -ENODEV, so the acpi_disable check outside the acpi_bus_register_driver() is duplicated, can be removed. Also we can just return from acpi_bus_register_driver() then we can simplify the code further. Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki --- drivers/acpi/sbs.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index e6d9f4de2800..cbd1af7ce7f4 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c @@ -714,16 +714,7 @@ static struct acpi_driver acpi_sbs_driver = { static int __init acpi_sbs_init(void) { - int result = 0; - - if (acpi_disabled) - return -ENODEV; - - result = acpi_bus_register_driver(&acpi_sbs_driver); - if (result < 0) - return -ENODEV; - - return 0; + return acpi_bus_register_driver(&acpi_sbs_driver); } static void __exit acpi_sbs_exit(void) -- cgit v1.2.3 From e882b0953ccc7ad9938251f9c7e00411a4ac48d7 Mon Sep 17 00:00:00 2001 From: Hanjun Guo Date: Fri, 13 Nov 2020 10:25:11 +0800 Subject: ACPI: SBS: Simplify the code using module_acpi_driver() Using the module_acpi_driver() to simplify the code. Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki --- drivers/acpi/sbs.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index cbd1af7ce7f4..3b0b6dd34914 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c @@ -711,17 +711,4 @@ static struct acpi_driver acpi_sbs_driver = { }, .drv.pm = &acpi_sbs_pm, }; - -static int __init acpi_sbs_init(void) -{ - return acpi_bus_register_driver(&acpi_sbs_driver); -} - -static void __exit acpi_sbs_exit(void) -{ - acpi_bus_unregister_driver(&acpi_sbs_driver); - return; -} - -module_init(acpi_sbs_init); -module_exit(acpi_sbs_exit); +module_acpi_driver(acpi_sbs_driver); -- cgit v1.2.3 From 907cc9fefe8349d6cc70d6800cc8edf10acf7634 Mon Sep 17 00:00:00 2001 From: Hanjun Guo Date: Fri, 13 Nov 2020 10:26:44 +0800 Subject: ACPI: tiny-power-button: Simplify the code using module_acpi_driver() Using module_acpi_driver() to simplify the code. Signed-off-by: Hanjun Guo Signed-off-by: Rafael J. Wysocki --- drivers/acpi/tiny-power-button.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/tiny-power-button.c b/drivers/acpi/tiny-power-button.c index 420e61b8eaae..a19f0e4e69f7 100644 --- a/drivers/acpi/tiny-power-button.c +++ b/drivers/acpi/tiny-power-button.c @@ -40,6 +40,4 @@ static struct acpi_driver acpi_tiny_power_button_driver = { }, }; -module_driver(acpi_tiny_power_button_driver, - acpi_bus_register_driver, - acpi_bus_unregister_driver); +module_acpi_driver(acpi_tiny_power_button_driver); -- cgit v1.2.3 From 55130fb22a1c396139c3da46f939bf5a6a92095e Mon Sep 17 00:00:00 2001 From: Punit Agrawal Date: Tue, 24 Nov 2020 08:59:51 +0900 Subject: ACPI: processor: Drop duplicate setting of shared_cpu_map 'shared_cpu_map', stored as part of the per-processor acpi_processor_performance structre, is used to store CPUs that share a performance domain. By definition it contains the owning CPU. While building the 'shared_cpu_map' it is being set twice - once while initialising the performance domains and again when matching CPUs belonging to the same domain. Drop the unnecessary initialisation. Signed-off-by: Punit Agrawal Signed-off-by: Rafael J. Wysocki --- drivers/acpi/processor_perflib.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index b04a68950ff1..b0d320f18163 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c @@ -616,7 +616,6 @@ int acpi_processor_preregister_performance( continue; pr->performance = per_cpu_ptr(performance, i); - cpumask_set_cpu(i, pr->performance->shared_cpu_map); pdomain = &(pr->performance->domain_info); if (acpi_processor_get_psd(pr->handle, pdomain)) { retval = -EINVAL; -- cgit v1.2.3