All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: declare clk_core_reparent_orphans() inline
@ 2019-12-17  4:41 Olof Johansson
  2019-12-17  4:45 ` [PATCH v2] " Olof Johansson
  2019-12-17  4:46 ` [PATCH v3] " Olof Johansson
  0 siblings, 2 replies; 6+ messages in thread
From: Olof Johansson @ 2019-12-17  4:41 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-clk, linux-kernel, Olof Johansson

A recent addition exposed a helper that is only used for
CONFIG_OF. Instead of figuring out best place to have it in the order
of various functions, just declare it as explicitly inline, and the
compiler will happily handle it without warning.

(Also fixup of a single stray empty line while I was looking at the code)

Fixes: 66d9506440bb ("clk: walk orphan list on clock provider registration")
Signed-off-by: Olof Johansson <olof@lixom.net>
---
 drivers/clk/clk.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index ae2795b30e060..dc1e6481f6b33 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3277,7 +3277,7 @@ static void clk_core_reparent_orphans_nolock(void)
 	}
 }
 
-static void clk_core_reparent_orphans(void)
+static void __maybe_unused clk_core_reparent_orphans(void)
 {
 	clk_prepare_lock();
 	clk_core_reparent_orphans_nolock();
@@ -3442,7 +3442,6 @@ static int __clk_core_init(struct clk_core *core)
 
 	clk_core_reparent_orphans_nolock();
 
-
 	kref_init(&core->ref);
 out:
 	clk_pm_runtime_put(core);
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2] clk: declare clk_core_reparent_orphans() inline
  2019-12-17  4:41 [PATCH] clk: declare clk_core_reparent_orphans() inline Olof Johansson
@ 2019-12-17  4:45 ` Olof Johansson
  2019-12-17  4:46 ` [PATCH v3] " Olof Johansson
  1 sibling, 0 replies; 6+ messages in thread
From: Olof Johansson @ 2019-12-17  4:45 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-clk, linux-kernel, Olof Johansson

A recent addition exposed a helper that is only used for
CONFIG_OF. Instead of figuring out best place to have it in the order
of various functions, just declare it as explicitly inline, and the
compiler will happily handle it without warning.

(Also fixup of a single stray empty line while I was looking at the code)

Fixes: 66d9506440bb ("clk: walk orphan list on clock provider registration")
Signed-off-by: Olof Johansson <olof@lixom.net>
---

v2: Forgot to amend when I switched from __maybe_unused to inline. Use
either version, your choice.

 drivers/clk/clk.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index ae2795b30e060..dc1e6481f6b33 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3277,7 +3277,7 @@ static void clk_core_reparent_orphans_nolock(void)
 	}
 }
 
-static void clk_core_reparent_orphans(void)
+static void __maybe_unused clk_core_reparent_orphans(void)
 {
 	clk_prepare_lock();
 	clk_core_reparent_orphans_nolock();
@@ -3442,7 +3442,6 @@ static int __clk_core_init(struct clk_core *core)
 
 	clk_core_reparent_orphans_nolock();
 
-
 	kref_init(&core->ref);
 out:
 	clk_pm_runtime_put(core);
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3] clk: declare clk_core_reparent_orphans() inline
  2019-12-17  4:41 [PATCH] clk: declare clk_core_reparent_orphans() inline Olof Johansson
  2019-12-17  4:45 ` [PATCH v2] " Olof Johansson
@ 2019-12-17  4:46 ` Olof Johansson
  2019-12-17  8:25   ` Stephen Boyd
  1 sibling, 1 reply; 6+ messages in thread
From: Olof Johansson @ 2019-12-17  4:46 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-clk, linux-kernel, Olof Johansson

A recent addition exposed a helper that is only used for
CONFIG_OF. Instead of figuring out best place to have it in the order
of various functions, just declare it as explicitly inline, and the
compiler will happily handle it without warning.

(Also fixup of a single stray empty line while I was looking at the code)

Fixes: 66d9506440bb ("clk: walk orphan list on clock provider registration")
Signed-off-by: Olof Johansson <olof@lixom.net>
---

v3: ACTUALLY amend this time. Sigh. Time to go home.

 drivers/clk/clk.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index ae2795b30e060..2b0f54b6af9d5 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3277,7 +3277,7 @@ static void clk_core_reparent_orphans_nolock(void)
 	}
 }
 
-static void clk_core_reparent_orphans(void)
+static void inline clk_core_reparent_orphans(void)
 {
 	clk_prepare_lock();
 	clk_core_reparent_orphans_nolock();
@@ -3442,7 +3442,6 @@ static int __clk_core_init(struct clk_core *core)
 
 	clk_core_reparent_orphans_nolock();
 
-
 	kref_init(&core->ref);
 out:
 	clk_pm_runtime_put(core);
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] clk: declare clk_core_reparent_orphans() inline
  2019-12-17  4:46 ` [PATCH v3] " Olof Johansson
@ 2019-12-17  8:25   ` Stephen Boyd
  2019-12-17 18:01     ` Olof Johansson
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Boyd @ 2019-12-17  8:25 UTC (permalink / raw)
  To: Michael Turquette, Olof Johansson; +Cc: linux-clk, linux-kernel, Olof Johansson

Quoting Olof Johansson (2019-12-16 20:46:35)
> A recent addition exposed a helper that is only used for
> CONFIG_OF. Instead of figuring out best place to have it in the order
> of various functions, just declare it as explicitly inline, and the
> compiler will happily handle it without warning.
> 
> (Also fixup of a single stray empty line while I was looking at the code)
> 
> Fixes: 66d9506440bb ("clk: walk orphan list on clock provider registration")
> Signed-off-by: Olof Johansson <olof@lixom.net>
> ---
> 
> v3: ACTUALLY amend this time. Sigh. Time to go home.
> 

Isn't it simple enough to just move the function down to CONFIG_OF in
drivers/clk/clk.c?

----8<----
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index ae2795b30e06..6a11239ccde3 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3277,13 +3277,6 @@ static void clk_core_reparent_orphans_nolock(void)
 	}
 }
 
-static void clk_core_reparent_orphans(void)
-{
-	clk_prepare_lock();
-	clk_core_reparent_orphans_nolock();
-	clk_prepare_unlock();
-}
-
 /**
  * __clk_core_init - initialize the data structures in a struct clk_core
  * @core:	clk_core being initialized
@@ -4193,6 +4186,13 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb)
 EXPORT_SYMBOL_GPL(clk_notifier_unregister);
 
 #ifdef CONFIG_OF
+static void clk_core_reparent_orphans(void)
+{
+	clk_prepare_lock();
+	clk_core_reparent_orphans_nolock();
+	clk_prepare_unlock();
+}
+
 /**
  * struct of_clk_provider - Clock provider registration structure
  * @link: Entry in global list of clock providers

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] clk: declare clk_core_reparent_orphans() inline
  2019-12-17  8:25   ` Stephen Boyd
@ 2019-12-17 18:01     ` Olof Johansson
  2019-12-17 19:46       ` Stephen Boyd
  0 siblings, 1 reply; 6+ messages in thread
From: Olof Johansson @ 2019-12-17 18:01 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: Michael Turquette, linux-clk, Linux Kernel Mailing List

On Tue, Dec 17, 2019 at 12:25 AM Stephen Boyd <sboyd@kernel.org> wrote:
>
> Quoting Olof Johansson (2019-12-16 20:46:35)
> > A recent addition exposed a helper that is only used for
> > CONFIG_OF. Instead of figuring out best place to have it in the order
> > of various functions, just declare it as explicitly inline, and the
> > compiler will happily handle it without warning.
> >
> > (Also fixup of a single stray empty line while I was looking at the code)
> >
> > Fixes: 66d9506440bb ("clk: walk orphan list on clock provider registration")
> > Signed-off-by: Olof Johansson <olof@lixom.net>
> > ---
> >
> > v3: ACTUALLY amend this time. Sigh. Time to go home.
> >
>
> Isn't it simple enough to just move the function down to CONFIG_OF in
> drivers/clk/clk.c?

"Simple" in a 5000 line file is maybe not the right word to use, but
yeah, sure, do with it what you want.

Seems like clk.c could do with some refactoring? :)


-Olof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] clk: declare clk_core_reparent_orphans() inline
  2019-12-17 18:01     ` Olof Johansson
@ 2019-12-17 19:46       ` Stephen Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2019-12-17 19:46 UTC (permalink / raw)
  To: Olof Johansson; +Cc: Michael Turquette, linux-clk, Linux Kernel Mailing List

Quoting Olof Johansson (2019-12-17 10:01:15)
> On Tue, Dec 17, 2019 at 12:25 AM Stephen Boyd <sboyd@kernel.org> wrote:
> >
> > Quoting Olof Johansson (2019-12-16 20:46:35)
> > > A recent addition exposed a helper that is only used for
> > > CONFIG_OF. Instead of figuring out best place to have it in the order
> > > of various functions, just declare it as explicitly inline, and the
> > > compiler will happily handle it without warning.
> > >
> > > (Also fixup of a single stray empty line while I was looking at the code)
> > >
> > > Fixes: 66d9506440bb ("clk: walk orphan list on clock provider registration")
> > > Signed-off-by: Olof Johansson <olof@lixom.net>
> > > ---
> > >
> > > v3: ACTUALLY amend this time. Sigh. Time to go home.
> > >
> >
> > Isn't it simple enough to just move the function down to CONFIG_OF in
> > drivers/clk/clk.c?
> 
> "Simple" in a 5000 line file is maybe not the right word to use, but
> yeah, sure, do with it what you want.
> 
> Seems like clk.c could do with some refactoring? :)
> 

Ok.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-12-17 19:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17  4:41 [PATCH] clk: declare clk_core_reparent_orphans() inline Olof Johansson
2019-12-17  4:45 ` [PATCH v2] " Olof Johansson
2019-12-17  4:46 ` [PATCH v3] " Olof Johansson
2019-12-17  8:25   ` Stephen Boyd
2019-12-17 18:01     ` Olof Johansson
2019-12-17 19:46       ` Stephen Boyd

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.