Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1248705 > unrolled thread

[PATCH] clk: Make clk input parameter of __clk_get_name() const

Started byGeert Uytterhoeven <geert+renesas@glider.be>
First post2015-10-16 14:40 +0200
Last post2015-10-16 21:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] clk: Make clk input parameter of __clk_get_name() const Geert Uytterhoeven <geert+renesas@glider.be> - 2015-10-16 14:40 +0200
    Re: [PATCH] clk: Make clk input parameter of __clk_get_name() const Stephen Boyd <sboyd@codeaurora.org> - 2015-10-16 21:00 +0200

#1248705 — [PATCH] clk: Make clk input parameter of __clk_get_name() const

FromGeert Uytterhoeven <geert+renesas@glider.be>
Date2015-10-16 14:40 +0200
Subject[PATCH] clk: Make clk input parameter of __clk_get_name() const
Message-ID<qkcsG-6ob-15@gated-at.bofh.it>
When calling __clk_get_name() on a const clock:

    warning: passing argument 1 of '__clk_get_name' discards 'const' qualifier from pointer target type
    include/linux/clk-provider.h:613:13: note: expected 'struct clk *' but argument is of type 'const struct clk *'

__clk_get_name() does not modify the passed clock, hence make it const.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/clk/clk.c            | 2 +-
 include/linux/clk-provider.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index b005f666e3a1a716..a8c59aee9eedf7e1 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -272,7 +272,7 @@ late_initcall_sync(clk_disable_unused);
 
 /***    helper functions   ***/
 
-const char *__clk_get_name(struct clk *clk)
+const char *__clk_get_name(const struct clk *clk)
 {
 	return !clk ? NULL : clk->core->name;
 }
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 8ff43eb4b3113a12..bbb8fed11e4479b2 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -607,7 +607,7 @@ void clk_unregister(struct clk *clk);
 void devm_clk_unregister(struct device *dev, struct clk *clk);
 
 /* helper functions */
-const char *__clk_get_name(struct clk *clk);
+const char *__clk_get_name(const struct clk *clk);
 const char *clk_hw_get_name(const struct clk_hw *hw);
 struct clk_hw *__clk_get_hw(struct clk *clk);
 unsigned int clk_hw_get_num_parents(const struct clk_hw *hw);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1249074

FromStephen Boyd <sboyd@codeaurora.org>
Date2015-10-16 21:00 +0200
Message-ID<qkioq-6zg-13@gated-at.bofh.it>
In reply to#1248705
On 10/16, Geert Uytterhoeven wrote:
> When calling __clk_get_name() on a const clock:
> 
>     warning: passing argument 1 of '__clk_get_name' discards 'const' qualifier from pointer target type
>     include/linux/clk-provider.h:613:13: note: expected 'struct clk *' but argument is of type 'const struct clk *'
> 
> __clk_get_name() does not modify the passed clock, hence make it const.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---

Applied to clk-next.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web