* [PATCH v2] clk: Constify struct clk_bulk_data * where possible
@ 2019-07-17 14:56 Andrey Smirnov
2019-08-08 4:56 ` Stephen Boyd
0 siblings, 1 reply; 2+ messages in thread
From: Andrey Smirnov @ 2019-07-17 14:56 UTC (permalink / raw)
To: linux-clk
Cc: Andrey Smirnov, Russell King, Stephen Boyd, Chris Healy, linux-kernel
The following functions:
- clk_bulk_enable()
- clk_bulk_prepare()
- clk_bulk_disable()
- clk_bulk_unprepare()
already expect const clk_bulk_data * as a second parameter, however
their no-op version have mismatching prototypes that don't. Fix that.
While at it, constify the second argument of clk_bulk_prepare_enable()
and clk_bulk_disable_unprepare(), since the functions they are
comprised of already accept const clk_bulk_data *.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Chris Healy <cphealy@gmail.com>
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
Changes since [v1]:
- Whole series squased into a single patch
[v1] lkml.kernel.org/r/20190715201234.13556-1-andrew.smirnov@gmail.com
include/linux/clk.h | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 3c096c7a51dc..7a795fd6d141 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -239,7 +239,8 @@ static inline int clk_prepare(struct clk *clk)
return 0;
}
-static inline int __must_check clk_bulk_prepare(int num_clks, struct clk_bulk_data *clks)
+static inline int __must_check
+clk_bulk_prepare(int num_clks, const struct clk_bulk_data *clks)
{
might_sleep();
return 0;
@@ -263,7 +264,8 @@ static inline void clk_unprepare(struct clk *clk)
{
might_sleep();
}
-static inline void clk_bulk_unprepare(int num_clks, struct clk_bulk_data *clks)
+static inline void clk_bulk_unprepare(int num_clks,
+ const struct clk_bulk_data *clks)
{
might_sleep();
}
@@ -819,7 +821,8 @@ static inline int clk_enable(struct clk *clk)
return 0;
}
-static inline int __must_check clk_bulk_enable(int num_clks, struct clk_bulk_data *clks)
+static inline int __must_check clk_bulk_enable(int num_clks,
+ const struct clk_bulk_data *clks)
{
return 0;
}
@@ -828,7 +831,7 @@ static inline void clk_disable(struct clk *clk) {}
static inline void clk_bulk_disable(int num_clks,
- struct clk_bulk_data *clks) {}
+ const struct clk_bulk_data *clks) {}
static inline unsigned long clk_get_rate(struct clk *clk)
{
@@ -917,8 +920,8 @@ static inline void clk_disable_unprepare(struct clk *clk)
clk_unprepare(clk);
}
-static inline int __must_check clk_bulk_prepare_enable(int num_clks,
- struct clk_bulk_data *clks)
+static inline int __must_check
+clk_bulk_prepare_enable(int num_clks, const struct clk_bulk_data *clks)
{
int ret;
@@ -933,7 +936,7 @@ static inline int __must_check clk_bulk_prepare_enable(int num_clks,
}
static inline void clk_bulk_disable_unprepare(int num_clks,
- struct clk_bulk_data *clks)
+ const struct clk_bulk_data *clks)
{
clk_bulk_disable(num_clks, clks);
clk_bulk_unprepare(num_clks, clks);
--
2.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] clk: Constify struct clk_bulk_data * where possible
2019-07-17 14:56 [PATCH v2] clk: Constify struct clk_bulk_data * where possible Andrey Smirnov
@ 2019-08-08 4:56 ` Stephen Boyd
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2019-08-08 4:56 UTC (permalink / raw)
To: Andrey Smirnov, linux-clk
Cc: Andrey Smirnov, Russell King, Chris Healy, linux-kernel
Quoting Andrey Smirnov (2019-07-17 07:56:51)
> The following functions:
>
> - clk_bulk_enable()
> - clk_bulk_prepare()
> - clk_bulk_disable()
> - clk_bulk_unprepare()
>
> already expect const clk_bulk_data * as a second parameter, however
> their no-op version have mismatching prototypes that don't. Fix that.
>
> While at it, constify the second argument of clk_bulk_prepare_enable()
> and clk_bulk_disable_unprepare(), since the functions they are
> comprised of already accept const clk_bulk_data *.
>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: Chris Healy <cphealy@gmail.com>
> Cc: linux-clk@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-08 4:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17 14:56 [PATCH v2] clk: Constify struct clk_bulk_data * where possible Andrey Smirnov
2019-08-08 4:56 ` 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).