Re: [PATCH v2] sched: Fix compiler warnings

2014-06-25 Thread Guenter Roeck
On 06/25/2014 05:59 PM, Stephen Rothwell wrote: Hi Guenter, [I know I'm a bit late to this, but ...] On Tue, 24 Jun 2014 18:05:29 -0700 Guenter Roeck wrote: diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index 9d85318..e35d880 100644 --- a/arch/arm/kernel/topology.c +++

Re: [PATCH v2] sched: Fix compiler warnings

2014-06-25 Thread Stephen Rothwell
Hi Guenter, [I know I'm a bit late to this, but ...] On Tue, 24 Jun 2014 18:05:29 -0700 Guenter Roeck wrote: > > diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c > index 9d85318..e35d880 100644 > --- a/arch/arm/kernel/topology.c > +++ b/arch/arm/kernel/topology.c > @@ -275,7

Re: [PATCH v2] sched: Fix compiler warnings

2014-06-25 Thread Guenter Roeck
On 06/25/2014 08:52 AM, Uwe Kleine-König wrote: Hello, On Wed, Jun 25, 2014 at 03:40:28PM +, David Laight wrote: From: Guenter Roeck Actually turns out one can use __attribute_const__, and it is static inline int __attribute_const__ cpu_corepower_flags(void) which turns out to be

RE: [PATCH v2] sched: Fix compiler warnings

2014-06-25 Thread David Laight
From: Uwe Kleine-König > Hello, > > On Wed, Jun 25, 2014 at 03:40:28PM +, David Laight wrote: > > From: Guenter Roeck > > > Actually turns out one can use __attribute_const__, and it is > > > > > > static inline int __attribute_const__ cpu_corepower_flags(void) > > > > > > which turns out t

Re: [PATCH v2] sched: Fix compiler warnings

2014-06-25 Thread Uwe Kleine-König
Hello, On Wed, Jun 25, 2014 at 03:40:28PM +, David Laight wrote: > From: Guenter Roeck > > Actually turns out one can use __attribute_const__, and it is > > > > static inline int __attribute_const__ cpu_corepower_flags(void) > > > > which turns out to be widely used. > > > > I'll change

RE: [PATCH v2] sched: Fix compiler warnings

2014-06-25 Thread David Laight
From: Guenter Roeck > On 06/25/2014 07:49 AM, Uwe Kleine-Knig wrote: > > Hello Guenter, > > > > On Wed, Jun 25, 2014 at 07:27:47AM -0700, Guenter Roeck wrote: > >>> Maybe the author's intention was: > >>> > >>> static inline int cpu_corepower_flags(void) __attribute__((const)); > >>> > >>> ? > >>

Re: [PATCH v2] sched: Fix compiler warnings

2014-06-25 Thread Guenter Roeck
On 06/25/2014 07:49 AM, Uwe Kleine-König wrote: Hello Guenter, On Wed, Jun 25, 2014 at 07:27:47AM -0700, Guenter Roeck wrote: Maybe the author's intention was: static inline int cpu_corepower_flags(void) __attribute__((const)); ? This specifies that the function has no side effects an

Re: [PATCH v2] sched: Fix compiler warnings

2014-06-25 Thread Uwe Kleine-König
Hello Guenter, On Wed, Jun 25, 2014 at 07:27:47AM -0700, Guenter Roeck wrote: > >Maybe the author's intention was: > > > > static inline int cpu_corepower_flags(void) __attribute__((const)); > > > >? > >This specifies that the function has no side effects and the return value > >only depends o

Re: [PATCH v2] sched: Fix compiler warnings

2014-06-25 Thread Guenter Roeck
On 06/25/2014 12:14 AM, Uwe Kleine-König wrote: On Tue, Jun 24, 2014 at 06:05:29PM -0700, Guenter Roeck wrote: Commit 143e1e28cb (sched: Rework sched_domain topology definition) introduced a number of functions with a return value of 'const int'. gcc doesn't know what to do with that and, if the

Re: [PATCH v2] sched: Fix compiler warnings

2014-06-25 Thread Uwe Kleine-König
On Tue, Jun 24, 2014 at 06:05:29PM -0700, Guenter Roeck wrote: > Commit 143e1e28cb (sched: Rework sched_domain topology definition) > introduced a number of functions with a return value of 'const int'. > gcc doesn't know what to do with that and, if the kernel is compiled > with W=1, complains wit

Re: [PATCH v2] sched: Fix compiler warnings

2014-06-24 Thread Vincent Guittot
On 25 June 2014 03:05, Guenter Roeck wrote: > Commit 143e1e28cb (sched: Rework sched_domain topology definition) > introduced a number of functions with a return value of 'const int'. > gcc doesn't know what to do with that and, if the kernel is compiled > with W=1, complains with the following wa

Re: [PATCH v2] sched: Fix compiler warnings

2014-06-24 Thread Benjamin Herrenschmidt
On Tue, 2014-06-24 at 18:05 -0700, Guenter Roeck wrote: .../... > Drop 'const' from the function declarations to fix the problem. > > The fix for all three patches has to be applied together to avoid > compilation failures for the affected architectures. > > Cc: Dietmar Eggemann > Cc: Peter Z

[PATCH v2] sched: Fix compiler warnings

2014-06-24 Thread Guenter Roeck
Commit 143e1e28cb (sched: Rework sched_domain topology definition) introduced a number of functions with a return value of 'const int'. gcc doesn't know what to do with that and, if the kernel is compiled with W=1, complains with the following warnings whenever sched.h is included. include/linux/s