All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: Avoid invalid function names in CLK_OF_DECLARE()
@ 2023-03-08 20:47 Nathan Chancellor
  2023-03-08 22:37 ` Saravana Kannan
  2023-03-09 23:39 ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Chancellor @ 2023-03-08 20:47 UTC (permalink / raw)
  To: mturquette, sboyd
  Cc: linus.walleij, saravanak, linux-clk, linux-kernel, Nathan Chancellor

After commit c28cd1f3433c ("clk: Mark a fwnode as initialized when using
CLK_OF_DECLARE() macro"), drivers/clk/mvebu/kirkwood.c fails to build:

 drivers/clk/mvebu/kirkwood.c:358:1: error: expected identifier or '('
 CLK_OF_DECLARE(98dx1135_clk, "marvell,mv98dx1135-core-clock",
 ^
 include/linux/clk-provider.h:1367:21: note: expanded from macro 'CLK_OF_DECLARE'
         static void __init name##_of_clk_init_declare(struct device_node *np) \
                            ^
 <scratch space>:124:1: note: expanded from here
 98dx1135_clk_of_clk_init_declare
 ^
 drivers/clk/mvebu/kirkwood.c:358:1: error: invalid digit 'd' in decimal constant
 include/linux/clk-provider.h:1372:34: note: expanded from macro 'CLK_OF_DECLARE'
         OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare)
                                         ^
 <scratch space>:125:3: note: expanded from here
 98dx1135_clk_of_clk_init_declare
   ^
 drivers/clk/mvebu/kirkwood.c:358:1: error: invalid digit 'd' in decimal constant
 include/linux/clk-provider.h:1372:34: note: expanded from macro 'CLK_OF_DECLARE'
         OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare)
                                         ^
 <scratch space>:125:3: note: expanded from here
 98dx1135_clk_of_clk_init_declare
   ^
 drivers/clk/mvebu/kirkwood.c:358:1: error: invalid digit 'd' in decimal constant
 include/linux/clk-provider.h:1372:34: note: expanded from macro 'CLK_OF_DECLARE'
         OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare)
                                         ^
 <scratch space>:125:3: note: expanded from here
 98dx1135_clk_of_clk_init_declare
   ^

C function names must start with either an alphabetic letter or an
underscore. To avoid generating invalid function names from clock names,
add two underscores to the beginning of the identifier.

Fixes: c28cd1f3433c ("clk: Mark a fwnode as initialized when using CLK_OF_DECLARE() macro")
Suggested-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 include/linux/clk-provider.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index c9f5276006a0..6f3175f0678a 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -1364,12 +1364,12 @@ struct clk_hw_onecell_data {
 };
 
 #define CLK_OF_DECLARE(name, compat, fn) \
-	static void __init name##_of_clk_init_declare(struct device_node *np) \
+	static void __init __##name##_of_clk_init_declare(struct device_node *np) \
 	{								\
 		fn(np);							\
 		fwnode_dev_initialized(of_fwnode_handle(np), true);	\
 	}								\
-	OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare)
+	OF_DECLARE_1(clk, name, compat, __##name##_of_clk_init_declare)
 
 /*
  * Use this macro when you have a driver that requires two initialization

---
base-commit: 89dc65a7cc8a119c395c0931b12d7a514f9d2bcc
change-id: 20230308-clk_of_declare-fix-4fb89765923e

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


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

* Re: [PATCH] clk: Avoid invalid function names in CLK_OF_DECLARE()
  2023-03-08 20:47 [PATCH] clk: Avoid invalid function names in CLK_OF_DECLARE() Nathan Chancellor
@ 2023-03-08 22:37 ` Saravana Kannan
  2023-03-09 23:39 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Saravana Kannan @ 2023-03-08 22:37 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: mturquette, sboyd, linus.walleij, linux-clk, linux-kernel

On Wed, Mar 8, 2023 at 12:47 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> After commit c28cd1f3433c ("clk: Mark a fwnode as initialized when using
> CLK_OF_DECLARE() macro"), drivers/clk/mvebu/kirkwood.c fails to build:
>
>  drivers/clk/mvebu/kirkwood.c:358:1: error: expected identifier or '('
>  CLK_OF_DECLARE(98dx1135_clk, "marvell,mv98dx1135-core-clock",
>  ^
>  include/linux/clk-provider.h:1367:21: note: expanded from macro 'CLK_OF_DECLARE'
>          static void __init name##_of_clk_init_declare(struct device_node *np) \
>                             ^
>  <scratch space>:124:1: note: expanded from here
>  98dx1135_clk_of_clk_init_declare
>  ^
>  drivers/clk/mvebu/kirkwood.c:358:1: error: invalid digit 'd' in decimal constant
>  include/linux/clk-provider.h:1372:34: note: expanded from macro 'CLK_OF_DECLARE'
>          OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare)
>                                          ^
>  <scratch space>:125:3: note: expanded from here
>  98dx1135_clk_of_clk_init_declare
>    ^
>  drivers/clk/mvebu/kirkwood.c:358:1: error: invalid digit 'd' in decimal constant
>  include/linux/clk-provider.h:1372:34: note: expanded from macro 'CLK_OF_DECLARE'
>          OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare)
>                                          ^
>  <scratch space>:125:3: note: expanded from here
>  98dx1135_clk_of_clk_init_declare
>    ^
>  drivers/clk/mvebu/kirkwood.c:358:1: error: invalid digit 'd' in decimal constant
>  include/linux/clk-provider.h:1372:34: note: expanded from macro 'CLK_OF_DECLARE'
>          OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare)
>                                          ^
>  <scratch space>:125:3: note: expanded from here
>  98dx1135_clk_of_clk_init_declare
>    ^
>
> C function names must start with either an alphabetic letter or an
> underscore. To avoid generating invalid function names from clock names,
> add two underscores to the beginning of the identifier.
>
> Fixes: c28cd1f3433c ("clk: Mark a fwnode as initialized when using CLK_OF_DECLARE() macro")
> Suggested-by: Saravana Kannan <saravanak@google.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  include/linux/clk-provider.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> index c9f5276006a0..6f3175f0678a 100644
> --- a/include/linux/clk-provider.h
> +++ b/include/linux/clk-provider.h
> @@ -1364,12 +1364,12 @@ struct clk_hw_onecell_data {
>  };
>
>  #define CLK_OF_DECLARE(name, compat, fn) \
> -       static void __init name##_of_clk_init_declare(struct device_node *np) \
> +       static void __init __##name##_of_clk_init_declare(struct device_node *np) \
>         {                                                               \
>                 fn(np);                                                 \
>                 fwnode_dev_initialized(of_fwnode_handle(np), true);     \
>         }                                                               \
> -       OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare)
> +       OF_DECLARE_1(clk, name, compat, __##name##_of_clk_init_declare)
>
>  /*
>   * Use this macro when you have a driver that requires two initialization

Thanks Nathan!

Reviewed-by: Saravana Kannan <saravanak@google.com>

-Saravana

>
> ---
> base-commit: 89dc65a7cc8a119c395c0931b12d7a514f9d2bcc
> change-id: 20230308-clk_of_declare-fix-4fb89765923e
>
> Best regards,
> --
> Nathan Chancellor <nathan@kernel.org>
>

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

* Re: [PATCH] clk: Avoid invalid function names in CLK_OF_DECLARE()
  2023-03-08 20:47 [PATCH] clk: Avoid invalid function names in CLK_OF_DECLARE() Nathan Chancellor
  2023-03-08 22:37 ` Saravana Kannan
@ 2023-03-09 23:39 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2023-03-09 23:39 UTC (permalink / raw)
  To: Nathan Chancellor, mturquette
  Cc: linus.walleij, saravanak, linux-clk, linux-kernel, Nathan Chancellor

Quoting Nathan Chancellor (2023-03-08 12:47:11)
> After commit c28cd1f3433c ("clk: Mark a fwnode as initialized when using
> CLK_OF_DECLARE() macro"), drivers/clk/mvebu/kirkwood.c fails to build:
> 
>  drivers/clk/mvebu/kirkwood.c:358:1: error: expected identifier or '('
>  CLK_OF_DECLARE(98dx1135_clk, "marvell,mv98dx1135-core-clock",
>  ^
>  include/linux/clk-provider.h:1367:21: note: expanded from macro 'CLK_OF_DECLARE'
>          static void __init name##_of_clk_init_declare(struct device_node *np) \
>                             ^
>  <scratch space>:124:1: note: expanded from here
>  98dx1135_clk_of_clk_init_declare
>  ^
>  drivers/clk/mvebu/kirkwood.c:358:1: error: invalid digit 'd' in decimal constant
>  include/linux/clk-provider.h:1372:34: note: expanded from macro 'CLK_OF_DECLARE'
>          OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare)
>                                          ^
>  <scratch space>:125:3: note: expanded from here
>  98dx1135_clk_of_clk_init_declare
>    ^
>  drivers/clk/mvebu/kirkwood.c:358:1: error: invalid digit 'd' in decimal constant
>  include/linux/clk-provider.h:1372:34: note: expanded from macro 'CLK_OF_DECLARE'
>          OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare)
>                                          ^
>  <scratch space>:125:3: note: expanded from here
>  98dx1135_clk_of_clk_init_declare
>    ^
>  drivers/clk/mvebu/kirkwood.c:358:1: error: invalid digit 'd' in decimal constant
>  include/linux/clk-provider.h:1372:34: note: expanded from macro 'CLK_OF_DECLARE'
>          OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare)
>                                          ^
>  <scratch space>:125:3: note: expanded from here
>  98dx1135_clk_of_clk_init_declare
>    ^
> 
> C function names must start with either an alphabetic letter or an
> underscore. To avoid generating invalid function names from clock names,
> add two underscores to the beginning of the identifier.
> 
> Fixes: c28cd1f3433c ("clk: Mark a fwnode as initialized when using CLK_OF_DECLARE() macro")
> Suggested-by: Saravana Kannan <saravanak@google.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---

Applied to clk-fixes

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

end of thread, other threads:[~2023-03-09 23:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08 20:47 [PATCH] clk: Avoid invalid function names in CLK_OF_DECLARE() Nathan Chancellor
2023-03-08 22:37 ` Saravana Kannan
2023-03-09 23:39 ` 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.