linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] clk: Mark a couple things const
@ 2022-02-17 22:05 Stephen Boyd
  2022-02-17 22:05 ` [PATCH 1/2] clk: Mark 'all_lists' as const Stephen Boyd
  2022-02-17 22:05 ` [PATCH 2/2] clk: Mark clk_core_evict_parent_cache_subtree() 'target' const Stephen Boyd
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Boyd @ 2022-02-17 22:05 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-kernel, linux-clk

Some spring cleaning.

Stephen Boyd (2):
  clk: Mark 'all_lists' as const
  clk: Mark clk_core_evict_parent_cache_subtree() 'target' const

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


base-commit: fa62806ece26d6a7e40e785e5297ecccfffd29a3
-- 
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/
https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git


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

* [PATCH 1/2] clk: Mark 'all_lists' as const
  2022-02-17 22:05 [PATCH 0/2] clk: Mark a couple things const Stephen Boyd
@ 2022-02-17 22:05 ` Stephen Boyd
  2022-02-26  1:04   ` Stephen Boyd
  2022-02-17 22:05 ` [PATCH 2/2] clk: Mark clk_core_evict_parent_cache_subtree() 'target' const Stephen Boyd
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Boyd @ 2022-02-17 22:05 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-kernel, linux-clk

This list array doesn't change at runtime. Mark it const to move to RO
memory.

Signed-off-by: Stephen Boyd <sboyd@kernel.org>
---
 drivers/clk/clk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 8de6a22498e7..16384e9437f5 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -37,7 +37,7 @@ static HLIST_HEAD(clk_root_list);
 static HLIST_HEAD(clk_orphan_list);
 static LIST_HEAD(clk_notifier_list);
 
-static struct hlist_head *all_lists[] = {
+static const struct hlist_head *all_lists[] = {
 	&clk_root_list,
 	&clk_orphan_list,
 	NULL,
@@ -4095,7 +4095,7 @@ static void clk_core_evict_parent_cache_subtree(struct clk_core *root,
 /* Remove this clk from all parent caches */
 static void clk_core_evict_parent_cache(struct clk_core *core)
 {
-	struct hlist_head **lists;
+	const struct hlist_head **lists;
 	struct clk_core *root;
 
 	lockdep_assert_held(&prepare_lock);
-- 
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/
https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git


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

* [PATCH 2/2] clk: Mark clk_core_evict_parent_cache_subtree() 'target' const
  2022-02-17 22:05 [PATCH 0/2] clk: Mark a couple things const Stephen Boyd
  2022-02-17 22:05 ` [PATCH 1/2] clk: Mark 'all_lists' as const Stephen Boyd
@ 2022-02-17 22:05 ` Stephen Boyd
  2022-02-26  1:05   ` Stephen Boyd
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Boyd @ 2022-02-17 22:05 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-kernel, linux-clk

Clarify that the 'target' clk isn't being modified, instead it's being
searched for. Mark it const so the function can't modify it.

Signed-off-by: Stephen Boyd <sboyd@kernel.org>
---
 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 16384e9437f5..d15997ea3930 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -4079,7 +4079,7 @@ static const struct clk_ops clk_nodrv_ops = {
 };
 
 static void clk_core_evict_parent_cache_subtree(struct clk_core *root,
-						struct clk_core *target)
+						const struct clk_core *target)
 {
 	int i;
 	struct clk_core *child;
-- 
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/
https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git


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

* Re: [PATCH 1/2] clk: Mark 'all_lists' as const
  2022-02-17 22:05 ` [PATCH 1/2] clk: Mark 'all_lists' as const Stephen Boyd
@ 2022-02-26  1:04   ` Stephen Boyd
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2022-02-26  1:04 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-kernel, linux-clk

Quoting Stephen Boyd (2022-02-17 14:05:53)
> This list array doesn't change at runtime. Mark it const to move to RO
> memory.
> 
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---

Applied to clk-next

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

* Re: [PATCH 2/2] clk: Mark clk_core_evict_parent_cache_subtree() 'target' const
  2022-02-17 22:05 ` [PATCH 2/2] clk: Mark clk_core_evict_parent_cache_subtree() 'target' const Stephen Boyd
@ 2022-02-26  1:05   ` Stephen Boyd
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2022-02-26  1:05 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd; +Cc: linux-kernel, linux-clk

Quoting Stephen Boyd (2022-02-17 14:05:54)
> Clarify that the 'target' clk isn't being modified, instead it's being
> searched for. Mark it const so the function can't modify it.
> 
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---

Applied to clk-next

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

end of thread, other threads:[~2022-02-26  1:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17 22:05 [PATCH 0/2] clk: Mark a couple things const Stephen Boyd
2022-02-17 22:05 ` [PATCH 1/2] clk: Mark 'all_lists' as const Stephen Boyd
2022-02-26  1:04   ` Stephen Boyd
2022-02-17 22:05 ` [PATCH 2/2] clk: Mark clk_core_evict_parent_cache_subtree() 'target' const Stephen Boyd
2022-02-26  1:05   ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).