Skip to contentSkip to conversation

pmdomains: fix unused variable warning with !PM_GENERIC_DOMAINS_OF

PATCH In review Johan Hovold 2 participants 3 messages Jun 11 – Jun 12 Generic PM domains

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pmdomains: fix unused variable warning with !PM_GENERIC_DOMAINS_OF

The genpd provider bus is really only used when CONFIG_PM_GENERIC_DOMAINS_OF is enabled, and since the recent deferred initialisation of domain parent devices, the root device pointer is otherwise unused.

Fix the unused variable warning by moving the definition of the root device pointer inside the corresponding ifdef.

Fixes ea1ca7623281 ("pmdomain: fix early domain registration")
---
 drivers/pmdomain/core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/pmdomain/core.c +4 -3
index 19eaee1819c8..f60eac6aa2ca 100644
@@ -32,9 +32,6 @@ static const struct bus_type genpd_provider_bus_type = {
 	.name		= "genpd_provider",
 };
 
-/* The parent for genpd_provider devices. */
-static struct device *genpd_provider_bus;
-
 #define GENPD_RETRY_MAX_MS	250		/* Approximate */
 
 #define GENPD_DEV_CALLBACK(genpd, type, callback, dev)		\
@@ -2566,6 +2563,10 @@ struct of_genpd_provider {
 static LIST_HEAD(of_genpd_providers);
 /* Mutex to protect the list above. */
 static DEFINE_MUTEX(of_genpd_mutex);
+
+/* The parent for genpd_provider devices. */
+static struct device *genpd_provider_bus;
+
 /* Used to prevent registering devices before the bus. */
 static bool genpd_bus_registered;
 
Signature · 1 line
2.53.0
#1 lore raw
Quoted 6 lines · Johan Hovold

The genpd provider bus is really only used when CONFIG_PM_GENERIC_DOMAINS_OF is enabled, and since the recent deferred initialisation of domain parent devices, the root device pointer is otherwise unused.

Quoted 7 lines

Fix the unused variable warning by moving the definition of the root device pointer inside the corresponding ifdef.

Fixes ea1ca7623281 ("pmdomain: fix early domain registration")

Applied for next, thanks!

Kind regards
Uffe

Quoted 32 lines
---
 drivers/pmdomain/core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/pmdomain/core.c +4 -4
index 19eaee1819c8..f60eac6aa2ca 100644
@@ -32,9 +32,6 @@ static const struct bus_type genpd_provider_bus_type = {
        .name           = "genpd_provider",
 };
 
-/* The parent for genpd_provider devices. */
-static struct device *genpd_provider_bus;
-
 #define GENPD_RETRY_MAX_MS     250             /* Approximate */
 
 #define GENPD_DEV_CALLBACK(genpd, type, callback, dev)         \
@@ -2566,6 +2563,10 @@ struct of_genpd_provider {
 static LIST_HEAD(of_genpd_providers);
 /* Mutex to protect the list above. */
 static DEFINE_MUTEX(of_genpd_mutex);
+
+/* The parent for genpd_provider devices. */
+static struct device *genpd_provider_bus;
+
 /* Used to prevent registering devices before the bus. */
 static bool genpd_bus_registered;
 
--

2.53.0

#2 lore raw
Quoted 10 lines · Ulf Hansson
Quoted 9 lines · Johan Hovold

The genpd provider bus is really only used when CONFIG_PM_GENERIC_DOMAINS_OF is enabled, and since the recent deferred initialisation of domain parent devices, the root device pointer is otherwise unused.

Fix the unused variable warning by moving the definition of the root device pointer inside the corresponding ifdef.

Quoted 6 lines
Quoted 4 lines
Fixes ea1ca7623281 ("pmdomain: fix early domain registration")

Applied for next, thanks!

Note that a stray 's' managed to sneak into the summary prefix ("pmdomains"). Just wanted to mention it while the commit is still HEAD in case you want to fix it up.

Johan