linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: spear: Move prototype to accessible header
@ 2022-10-10  4:22 Viresh Kumar
  2022-10-11  1:01 ` Stephen Boyd
  0 siblings, 1 reply; 4+ messages in thread
From: Viresh Kumar @ 2022-10-10  4:22 UTC (permalink / raw)
  To: Viresh Kumar, Shiraz Hashim, soc, Russell King,
	Michael Turquette, Stephen Boyd
  Cc: Viresh Kumar, kernel test robot, linux-arm-kernel, linux-kernel,
	linux-clk

Fixes the following W=1 kernel build warning(s):

 drivers/clk/spear/spear6xx_clock.c:116:13: warning: no previous prototype for function 'spear6xx_clk_init' [-Wmissing-prototypes]

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 arch/arm/mach-spear/generic.h      |  3 ---
 arch/arm/mach-spear/spear3xx.c     |  1 +
 arch/arm/mach-spear/spear6xx.c     |  1 +
 drivers/clk/spear/spear3xx_clock.c |  1 +
 drivers/clk/spear/spear6xx_clock.c |  1 +
 include/linux/clk/spear.h          | 14 ++++++++++++++
 6 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-spear/generic.h b/arch/arm/mach-spear/generic.h
index 43b7996ab754..9e36920d4cfd 100644
--- a/arch/arm/mach-spear/generic.h
+++ b/arch/arm/mach-spear/generic.h
@@ -25,11 +25,8 @@ extern struct pl022_ssp_controller pl022_plat_data;
 extern struct pl08x_platform_data pl080_plat_data;
 
 void __init spear_setup_of_timer(void);
-void __init spear3xx_clk_init(void __iomem *misc_base,
-			      void __iomem *soc_config_base);
 void __init spear3xx_map_io(void);
 void __init spear3xx_dt_init_irq(void);
-void __init spear6xx_clk_init(void __iomem *misc_base);
 void __init spear13xx_map_io(void);
 void __init spear13xx_l2x0_init(void);
 
diff --git a/arch/arm/mach-spear/spear3xx.c b/arch/arm/mach-spear/spear3xx.c
index 2ba406e92c41..7ef9670d3029 100644
--- a/arch/arm/mach-spear/spear3xx.c
+++ b/arch/arm/mach-spear/spear3xx.c
@@ -13,6 +13,7 @@
 #include <linux/amba/pl022.h>
 #include <linux/amba/pl080.h>
 #include <linux/clk.h>
+#include <linux/clk/spear.h>
 #include <linux/io.h>
 #include <asm/mach/map.h>
 #include "pl080.h"
diff --git a/arch/arm/mach-spear/spear6xx.c b/arch/arm/mach-spear/spear6xx.c
index 7a5fff134872..f0a1e704cceb 100644
--- a/arch/arm/mach-spear/spear6xx.c
+++ b/arch/arm/mach-spear/spear6xx.c
@@ -12,6 +12,7 @@
 
 #include <linux/amba/pl08x.h>
 #include <linux/clk.h>
+#include <linux/clk/spear.h>
 #include <linux/err.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
diff --git a/drivers/clk/spear/spear3xx_clock.c b/drivers/clk/spear/spear3xx_clock.c
index 41717ff707f6..ba8791303156 100644
--- a/drivers/clk/spear/spear3xx_clock.c
+++ b/drivers/clk/spear/spear3xx_clock.c
@@ -8,6 +8,7 @@
 
 #include <linux/clk.h>
 #include <linux/clkdev.h>
+#include <linux/clk/spear.h>
 #include <linux/err.h>
 #include <linux/io.h>
 #include <linux/of_platform.h>
diff --git a/drivers/clk/spear/spear6xx_clock.c b/drivers/clk/spear/spear6xx_clock.c
index 490701ac9e93..c192a9141b86 100644
--- a/drivers/clk/spear/spear6xx_clock.c
+++ b/drivers/clk/spear/spear6xx_clock.c
@@ -7,6 +7,7 @@
  */
 
 #include <linux/clkdev.h>
+#include <linux/clk/spear.h>
 #include <linux/io.h>
 #include <linux/spinlock_types.h>
 #include "clk.h"
diff --git a/include/linux/clk/spear.h b/include/linux/clk/spear.h
index a64d034ceddd..eaf95ca656f8 100644
--- a/include/linux/clk/spear.h
+++ b/include/linux/clk/spear.h
@@ -8,6 +8,20 @@
 #ifndef __LINUX_CLK_SPEAR_H
 #define __LINUX_CLK_SPEAR_H
 
+#ifdef CONFIG_ARCH_SPEAR3XX
+void __init spear3xx_clk_init(void __iomem *misc_base,
+			      void __iomem *soc_config_base);
+#else
+static inline void __init spear3xx_clk_init(void __iomem *misc_base,
+					    void __iomem *soc_config_base) {}
+#endif
+
+#ifdef CONFIG_ARCH_SPEAR6XX
+void __init spear6xx_clk_init(void __iomem *misc_base);
+#else
+static inline void __init spear6xx_clk_init(void __iomem *misc_base) {}
+#endif
+
 #ifdef CONFIG_MACH_SPEAR1310
 void __init spear1310_clk_init(void __iomem *misc_base, void __iomem *ras_base);
 #else
-- 
2.31.1.272.g89b43f80a514


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] clk: spear: Move prototype to accessible header
  2022-10-10  4:22 [PATCH] clk: spear: Move prototype to accessible header Viresh Kumar
@ 2022-10-11  1:01 ` Stephen Boyd
  2022-10-11  3:11   ` Viresh Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Boyd @ 2022-10-11  1:01 UTC (permalink / raw)
  To: Michael Turquette, Russell King, Shiraz Hashim, Viresh Kumar,
	Viresh Kumar, soc
  Cc: Viresh Kumar, kernel test robot, linux-arm-kernel, linux-kernel,
	linux-clk

Quoting Viresh Kumar (2022-10-09 21:22:37)
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/clk/spear/spear6xx_clock.c:116:13: warning: no previous prototype for function 'spear6xx_clk_init' [-Wmissing-prototypes]
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---

Acked-by: Stephen Boyd <sboyd@kernel.org>

> diff --git a/include/linux/clk/spear.h b/include/linux/clk/spear.h
> index a64d034ceddd..eaf95ca656f8 100644
> --- a/include/linux/clk/spear.h
> +++ b/include/linux/clk/spear.h
> @@ -8,6 +8,20 @@
>  #ifndef __LINUX_CLK_SPEAR_H
>  #define __LINUX_CLK_SPEAR_H
>  
> +#ifdef CONFIG_ARCH_SPEAR3XX
> +void __init spear3xx_clk_init(void __iomem *misc_base,

__init is meaningless in header files

> +                             void __iomem *soc_config_base);
> +#else
> +static inline void __init spear3xx_clk_init(void __iomem *misc_base,
> +                                           void __iomem *soc_config_base) {}
> +#endif
> +

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] clk: spear: Move prototype to accessible header
  2022-10-11  1:01 ` Stephen Boyd
@ 2022-10-11  3:11   ` Viresh Kumar
  2022-10-11  3:46     ` Stephen Boyd
  0 siblings, 1 reply; 4+ messages in thread
From: Viresh Kumar @ 2022-10-11  3:11 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Michael Turquette, Russell King, Shiraz Hashim, Viresh Kumar,
	soc, kernel test robot, linux-arm-kernel, linux-kernel,
	linux-clk

On 10-10-22, 18:01, Stephen Boyd wrote:
> __init is meaningless in header files

Technically yes.

But then I grepped include/ and it is widely used, even by core kernel
headers. Why is that ? Maybe just to keep prototype consistent ?

Also init.h says:

 * If the function has a prototype somewhere, you can also add
 * __init between closing brace of the prototype and semicolon:
 *
 * extern int initialize_foobar_device(int, int, int) __init;

Hmm, I understand that it is just saying that __init can be used after
function's name instead of just before, but isn't it also suggesting
that headers may also have it (maybe just to keep it consistent) ?

-- 
viresh

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] clk: spear: Move prototype to accessible header
  2022-10-11  3:11   ` Viresh Kumar
@ 2022-10-11  3:46     ` Stephen Boyd
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2022-10-11  3:46 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Michael Turquette, Russell King, Shiraz Hashim, Viresh Kumar,
	soc, kernel test robot, linux-arm-kernel, linux-kernel,
	linux-clk

Quoting Viresh Kumar (2022-10-10 20:11:04)
> On 10-10-22, 18:01, Stephen Boyd wrote:
> > __init is meaningless in header files
> 
> Technically yes.
> 
> But then I grepped include/ and it is widely used, even by core kernel
> headers. Why is that ? Maybe just to keep prototype consistent ?
> 
> Also init.h says:
> 
>  * If the function has a prototype somewhere, you can also add
>  * __init between closing brace of the prototype and semicolon:
>  *
>  * extern int initialize_foobar_device(int, int, int) __init;
> 
> Hmm, I understand that it is just saying that __init can be used after
> function's name instead of just before, but isn't it also suggesting
> that headers may also have it (maybe just to keep it consistent) ?
> 

I didn't say it was forbidden ;)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-10-11  3:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-10  4:22 [PATCH] clk: spear: Move prototype to accessible header Viresh Kumar
2022-10-11  1:01 ` Stephen Boyd
2022-10-11  3:11   ` Viresh Kumar
2022-10-11  3:46     ` 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).