linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Remove inline from clock framework function definitions to build the kernel with GCC 4.7
@ 2012-11-15 17:07 Igor Mazanov
  2012-11-15 18:24 ` Jon Hunter
  2012-11-15 18:46 ` Paul Walmsley
  0 siblings, 2 replies; 6+ messages in thread
From: Igor Mazanov @ 2012-11-15 17:07 UTC (permalink / raw)
  To: linux-omap; +Cc: Paul Walmsley, tony, linux, linux-arm-kernel, linux-kernel

  Remove inline from clock framework function definitions to
  build the kernel with GCC 4.7

Signed-off-by: Igor Mazanov <i.mazanov@gmail.com>
---
  include/linux/clk-provider.h |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index c127315..f9f5e9e 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -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

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

* Re: [PATCH] Remove inline from clock framework function definitions to build the kernel with GCC 4.7
  2012-11-15 17:07 [PATCH] Remove inline from clock framework function definitions to build the kernel with GCC 4.7 Igor Mazanov
@ 2012-11-15 18:24 ` Jon Hunter
  2012-11-15 18:45   ` Paul Walmsley
  2012-11-15 18:46 ` Paul Walmsley
  1 sibling, 1 reply; 6+ messages in thread
From: Jon Hunter @ 2012-11-15 18:24 UTC (permalink / raw)
  To: i.mazanov, Mike Turquette
  Cc: linux-omap, Paul Walmsley, tony, linux, linux-arm-kernel, linux-kernel


On 11/15/2012 11:07 AM, Igor Mazanov wrote:
>  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

 
> Signed-off-by: Igor Mazanov <i.mazanov@gmail.com>
> ---
>  include/linux/clk-provider.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> index c127315..f9f5e9e 100644
> --- a/include/linux/clk-provider.h
> +++ b/include/linux/clk-provider.h
> @@ -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

[1] https://bugs.launchpad.net/linaro-android/+bug/983496

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

* Re: [PATCH] Remove inline from clock framework function definitions to build the kernel with GCC 4.7
  2012-11-15 18:24 ` Jon Hunter
@ 2012-11-15 18:45   ` Paul Walmsley
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Walmsley @ 2012-11-15 18:45 UTC (permalink / raw)
  To: Jon Hunter, i.mazanov
  Cc: Mike Turquette, linux-omap, tony, linux, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1474 bytes --]

On Thu, 15 Nov 2012, Jon Hunter wrote:

> 
> On 11/15/2012 11:07 AM, Igor Mazanov wrote:
> >  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

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.

> Do we also need to remove the inline from the functions declared in
> drivers/clk/clk.c too?

It's usually best to just let the compiler decide whether to inline 
functions.  For example, Documentation/CodingStyle Chapter 15.


- Paul

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

* Re: [PATCH] Remove inline from clock framework function definitions to build the kernel with GCC 4.7
  2012-11-15 17:07 [PATCH] Remove inline from clock framework function definitions to build the kernel with GCC 4.7 Igor Mazanov
  2012-11-15 18:24 ` Jon Hunter
@ 2012-11-15 18:46 ` Paul Walmsley
  2012-11-16 17:16   ` Igor Mazanov
  1 sibling, 1 reply; 6+ messages in thread
From: Paul Walmsley @ 2012-11-15 18:46 UTC (permalink / raw)
  To: Igor Mazanov, mturquette
  Cc: linux-omap, tony, linux, linux-arm-kernel, linux-kernel

+ Mike

On Thu, 15 Nov 2012, Igor Mazanov wrote:

>  Remove inline from clock framework function definitions to
>  build the kernel with GCC 4.7

sparse warns about this also.

> Signed-off-by: Igor Mazanov <i.mazanov@gmail.com>

This one is for Mike to deal with as CCF maintainer; it's out of the hands 
of the OMAP folks.

Acked-by: Paul Walmsley <paul@pwsan.com>


> ---
>  include/linux/clk-provider.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> index c127315..f9f5e9e 100644
> --- a/include/linux/clk-provider.h
> +++ b/include/linux/clk-provider.h
> @@ -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
> 


- Paul

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

* Re: [PATCH] Remove inline from clock framework function definitions to build the kernel with GCC 4.7
  2012-11-15 18:46 ` Paul Walmsley
@ 2012-11-16 17:16   ` Igor Mazanov
  2012-11-16 17:39     ` Mike Turquette
  0 siblings, 1 reply; 6+ messages in thread
From: Igor Mazanov @ 2012-11-16 17:16 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: mturquette, linux-omap, tony, linux, linux-arm-kernel, linux-kernel

Paul Walmsley wrote:
> + Mike
> 
> On Thu, 15 Nov 2012, Igor Mazanov wrote:
> 
>>  Remove inline from clock framework function definitions to
>>  build the kernel with GCC 4.7
> 
> sparse warns about this also.
> 
>> Signed-off-by: Igor Mazanov <i.mazanov@gmail.com>
> 
> 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.

> 
> Acked-by: Paul Walmsley <paul@pwsan.com>
> 
> 
>> ---
>>  include/linux/clk-provider.h |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
>> index c127315..f9f5e9e 100644
>> --- a/include/linux/clk-provider.h
>> +++ b/include/linux/clk-provider.h
>> @@ -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
>>
> 
> 
> - Paul


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

* Re: [PATCH] Remove inline from clock framework function definitions to build the kernel with GCC 4.7
  2012-11-16 17:16   ` Igor Mazanov
@ 2012-11-16 17:39     ` Mike Turquette
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Turquette @ 2012-11-16 17:39 UTC (permalink / raw)
  To: i.mazanov, Igor Mazanov, Paul Walmsley
  Cc: linux-omap, tony, linux, linux-arm-kernel, linux-kernel

Quoting Igor Mazanov (2012-11-16 09:16:02)
> Paul Walmsley wrote:
> > + Mike
> > 
> > On Thu, 15 Nov 2012, Igor Mazanov wrote:
> > 
> >>  Remove inline from clock framework function definitions to
> >>  build the kernel with GCC 4.7
> > 
> > sparse warns about this also.
> > 
> >> Signed-off-by: Igor Mazanov <i.mazanov@gmail.com>
> > 
> > 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

> > 
> > Acked-by: Paul Walmsley <paul@pwsan.com>
> > 
> > 
> >> ---
> >>  include/linux/clk-provider.h |    4 ++--
> >>  1 files changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> >> index c127315..f9f5e9e 100644
> >> --- a/include/linux/clk-provider.h
> >> +++ b/include/linux/clk-provider.h
> >> @@ -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
> >>
> > 
> > 
> > - Paul

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

end of thread, other threads:[~2012-11-16 17:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15 17:07 [PATCH] Remove inline from clock framework function definitions to build the kernel with GCC 4.7 Igor Mazanov
2012-11-15 18:24 ` Jon Hunter
2012-11-15 18:45   ` Paul Walmsley
2012-11-15 18:46 ` Paul Walmsley
2012-11-16 17:16   ` Igor Mazanov
2012-11-16 17:39     ` Mike Turquette

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).