Remove inline from clock framework function definitions to build the kernel with GCC 4.7
PATCH 1/1 Remove inline from clock framework function definitions to build the kernel with GCC 4.7
Remove inline from clock framework function definitions to build the kernel with GCC 4.7
--- include/linux/clk-provider.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
include/linux/clk-provider.h +2 -2
@@ -335,8 +335,8 @@ const char *__clk_get_name(struct clk *clk);struct clk_hw *__clk_get_hw (struct clk *clk);u8 __clk_get_num_parents (struct clk *clk);struct clk *__clk_get_parent (struct clk *clk); -inline int __clk_get_enable_count (struct clk *clk); -inline int __clk_get_prepare_count (struct clk *clk); +int __clk_get_enable_count (struct clk *clk); +int __clk_get_prepare_count (struct clk *clk);unsigned long __clk_get_rate (struct clk *clk);unsigned long __clk_get_flags (struct clk *clk);int __clk_is_enabled (struct clk *clk);
--
1.7.4.4
Quoted 2 lines · Igor Mazanov
Remove inline from clock framework function definitions to build the kernel with GCC 4.7
Adding Mike to the party ...
May be good to add some details about the exact problem seen.
I am seeing the same problem today with GCC 4.7 and Tony's master branch. For a bit of background it seems that for 4.7 not having the body of the inlined function available in the header is causing this error. Another example here [1].
The actual compiler error seen for OMAP is ...
In file included from arch/arm/mach-omap2/clockdomain.c:25:0:arch/arm/mach-omap2/clockdomain.c: In function ?clkdm_clk_disable?:include/linux/clk-provider.h:338:12: error: inlining failed in call to always_inline ?__clk_get_enable_count?: function body not available arch/arm/mach-omap2/clockdomain.c:1001:28: error: called from here
make[1]: *** [arch/arm/mach-omap2/clockdomain.o] Error 1
make: *** [arch/arm/mach-omap2] Error 2
Quoted 10 lines
Signed-off-by Igor Mazanov <[email protected]>--- include/linux/clk-provider.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)include/linux/clk-provider.h +0
-0
include/linux/clk-provider.h const char *__clk_get_name(struct clk *clk); · line 342
Quoted 10 lines
include/linux/clk-provider.h +2
-2@@ -335,8 +335,8 @@ const char *__clk_get_name(struct clk *clk);struct clk_hw *__clk_get_hw (struct clk *clk);u8 __clk_get_num_parents (struct clk *clk);struct clk *__clk_get_parent (struct clk *clk); -inline int __clk_get_enable_count (struct clk *clk); -inline int __clk_get_prepare_count (struct clk *clk); +int __clk_get_enable_count (struct clk *clk); +int __clk_get_prepare_count (struct clk *clk);unsigned long __clk_get_rate (struct clk *clk);unsigned long __clk_get_flags (struct clk *clk);int __clk_is_enabled (struct clk *clk);
Do we also need to remove the inline from the functions declared in drivers/clk/clk.c too?
Cheers
Jon
Quoted 14 lines · Jon Hunter
Quoted 2 lines · Igor Mazanov
Remove inline from clock framework function definitions to build the kernel with GCC 4.7
Adding Mike to the party ...
May be good to add some details about the exact problem seen.
I am seeing the same problem today with GCC 4.7 and Tony's master branch. For a bit of background it seems that for 4.7 not having the body of the inlined function available in the header is causing this error. Another example here [1].
Quoted 8 lines
The actual compiler error seen for OMAP is ...
In file included from
arch/arm/mach-omap2/clockdomain.c:25:0:arch/arm/mach-omap2/clockdomain.c: In function ?clkdm_clk_disable?:include/linux/clk-provider.h:338:12: error: inlining failed in call toalways_inline?__clk_get_enable_count?: function body not availablearch/arm/mach-omap2/clockdomain.c:1001:28: error: called from here
make[1]: *** [arch/arm/mach-omap2/clockdomain.o] Error 1
make: *** [arch/arm/mach-omap2] Error 2
Yep this one is for Mike to fix in the main CCF code; it's not an OMAP-specific issue. sparse warns about this too, so it's not just a gcc 4.7 problem.
Quoted 2 lines
Do we also need to remove the inline from the functions declared in
drivers/clk/clk.ctoo?
It's usually best to just let the compiler decide whether to inline functions. For example, Documentation/CodingStyle Chapter 15.
- Paul
+ Mike
Quoted 2 lines · Igor Mazanov
Remove inline from clock framework function definitions to build the kernel with GCC 4.7
sparse warns about this also.
Quoted 1 line
Signed-off-by Igor Mazanov <[email protected]>
This one is for Mike to deal with as CCF maintainer; it's out of the hands of the OMAP folks.
Quoted 20 lines
--- include/linux/clk-provider.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)include/linux/clk-provider.h +2
-3@@ -335,8 +335,8 @@ const char *__clk_get_name(struct clk *clk);struct clk_hw *__clk_get_hw (struct clk *clk);u8 __clk_get_num_parents (struct clk *clk);struct clk *__clk_get_parent (struct clk *clk); -inline int __clk_get_enable_count (struct clk *clk); -inline int __clk_get_prepare_count (struct clk *clk); +int __clk_get_enable_count (struct clk *clk); +int __clk_get_prepare_count (struct clk *clk);unsigned long __clk_get_rate (struct clk *clk);unsigned long __clk_get_flags (struct clk *clk);int __clk_is_enabled (struct clk *clk); --
Quoted 2 lines
1.7.4.4
- Paul
Quoted 4 lines · Paul Walmsley
+ Mike
On Thu, 15 Nov 2012, Igor Mazanov wrote:
Quoted 8 lines
Quoted 2 lines
Remove inline from clock framework function definitions to build the kernel with GCC 4.7
sparse warns about this also.
Quoted 1 line
Signed-off-by Igor Mazanov <[email protected]>This one is for Mike to deal with as CCF maintainer; it's out of the hands of the OMAP folks.
Thanks for comments, I'll bear in mind it for the future.
Quoted 29 lines
Acked-by Paul Walmsley <[email protected]>Quoted 20 lines
--- include/linux/clk-provider.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)include/linux/clk-provider.h +2
-3@@ -335,8 +335,8 @@ const char *__clk_get_name(struct clk *clk);struct clk_hw *__clk_get_hw (struct clk *clk);u8 __clk_get_num_parents (struct clk *clk);struct clk *__clk_get_parent (struct clk *clk); -inline int __clk_get_enable_count (struct clk *clk); -inline int __clk_get_prepare_count (struct clk *clk); +int __clk_get_enable_count (struct clk *clk); +int __clk_get_prepare_count (struct clk *clk);unsigned long __clk_get_rate (struct clk *clk);unsigned long __clk_get_flags (struct clk *clk);int __clk_is_enabled (struct clk *clk); --Quoted 2 lines
1.7.4.4
- Paul
Quoting Igor Mazanov (2012-11-16 09:16:02)
Quoted 8 lines
Quoted 7 lines · Paul Walmsley
+ Mike
Quoted 2 lines · Igor Mazanov
Remove inline from clock framework function definitions to build the kernel with GCC 4.7
Quoted 9 lines
Quoted 6 lines
sparse warns about this also.
Quoted 1 line
Signed-off-by Igor Mazanov <[email protected]>This one is for Mike to deal with as CCF maintainer; it's out of the hands of the OMAP folks.
Thanks for comments, I'll bear in mind it for the future.
I forgot to reply to this thread yesterday. A fixes request has been sent out, hopefully will be picked up for 3.7-rc6.
Thanks all,
Mike
Quoted 29 lines
Quoted 29 lines
Acked-by Paul Walmsley <[email protected]>Quoted 20 lines
--- include/linux/clk-provider.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)include/linux/clk-provider.h +2
-3@@ -335,8 +335,8 @@ const char *__clk_get_name(struct clk *clk);struct clk_hw *__clk_get_hw (struct clk *clk);u8 __clk_get_num_parents (struct clk *clk);struct clk *__clk_get_parent (struct clk *clk); -inline int __clk_get_enable_count (struct clk *clk); -inline int __clk_get_prepare_count (struct clk *clk); +int __clk_get_enable_count (struct clk *clk); +int __clk_get_prepare_count (struct clk *clk);unsigned long __clk_get_rate (struct clk *clk);unsigned long __clk_get_flags (struct clk *clk);int __clk_is_enabled (struct clk *clk); --Quoted 2 lines
1.7.4.4
- Paul