All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org, Paul Mackerras <paulus@samba.org>,
	linux-kernel@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>
Subject: Re: [PATCH] powerpc: Fix build warning
Date: Mon, 23 Jun 2014 23:01:45 -0700	[thread overview]
Message-ID: <53A91449.6010701@roeck-us.net> (raw)
In-Reply-To: <1403588053.4587.160.camel@pasglop>

On 06/23/2014 10:34 PM, Benjamin Herrenschmidt wrote:
> On Mon, 2014-06-23 at 22:05 -0700, Guenter Roeck wrote:
>> On 06/23/2014 09:35 PM, Benjamin Herrenschmidt wrote:
>>> On Fri, 2014-06-13 at 09:38 -0700, Guenter Roeck wrote:
>>>> If compiled with W=1, the following warning is seen in powerpc builds.
>>>>
>>>> arch/powerpc/kernel/smp.c:750:18: warning:
>>>> 	type qualifiers ignored on function return type
>>>> static const int powerpc_smt_flags(void)
>>>>                    ^
>>>>
>>>> This is caused by a function returning 'const int', which doesn't
>>>> make sense to gcc. Drop 'const' to fix the problem.
>>>
>>> This breaks the 64-bit build:
>>>
>>> arch/powerpc/kernel/smp.c:764:2: error: initialization from incompatible pointer type [-Werror]
>>> arch/powerpc/kernel/smp.c:764:2: error: (near initialization for 'powerpc_topology[0].sd_flags') [-Werror]
>>>
>>> It appears that the generic definition in sched.h has this function
>>> defined as const int, so that needs to be fixed too along with all
>>> instances in all archs.
>>>
>>
>> https://lkml.org/lkml/2014/6/12/743
>
> Won't the patch above break powerpc then ? IE. The functions signature
> won't match anymore ... /me thinks you probably need to fix them all
> at once.
>

I thought that only happens if a const is dropped, but maybe not.

Sigh. Much easier to break something than to fix it. That would mean to get approval
from at least three maintainers, and all that to get rid of a warning. I don't
really have time for that. Let's just forget about it and live with the warning.

Guenter

WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>
Subject: Re: [PATCH] powerpc: Fix build warning
Date: Mon, 23 Jun 2014 23:01:45 -0700	[thread overview]
Message-ID: <53A91449.6010701@roeck-us.net> (raw)
In-Reply-To: <1403588053.4587.160.camel@pasglop>

On 06/23/2014 10:34 PM, Benjamin Herrenschmidt wrote:
> On Mon, 2014-06-23 at 22:05 -0700, Guenter Roeck wrote:
>> On 06/23/2014 09:35 PM, Benjamin Herrenschmidt wrote:
>>> On Fri, 2014-06-13 at 09:38 -0700, Guenter Roeck wrote:
>>>> If compiled with W=1, the following warning is seen in powerpc builds.
>>>>
>>>> arch/powerpc/kernel/smp.c:750:18: warning:
>>>> 	type qualifiers ignored on function return type
>>>> static const int powerpc_smt_flags(void)
>>>>                    ^
>>>>
>>>> This is caused by a function returning 'const int', which doesn't
>>>> make sense to gcc. Drop 'const' to fix the problem.
>>>
>>> This breaks the 64-bit build:
>>>
>>> arch/powerpc/kernel/smp.c:764:2: error: initialization from incompatible pointer type [-Werror]
>>> arch/powerpc/kernel/smp.c:764:2: error: (near initialization for 'powerpc_topology[0].sd_flags') [-Werror]
>>>
>>> It appears that the generic definition in sched.h has this function
>>> defined as const int, so that needs to be fixed too along with all
>>> instances in all archs.
>>>
>>
>> https://lkml.org/lkml/2014/6/12/743
>
> Won't the patch above break powerpc then ? IE. The functions signature
> won't match anymore ... /me thinks you probably need to fix them all
> at once.
>

I thought that only happens if a const is dropped, but maybe not.

Sigh. Much easier to break something than to fix it. That would mean to get approval
from at least three maintainers, and all that to get rid of a warning. I don't
really have time for that. Let's just forget about it and live with the warning.

Guenter


  reply	other threads:[~2014-06-24  6:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-13 16:38 [PATCH] powerpc: Fix build warning Guenter Roeck
2014-06-13 16:38 ` Guenter Roeck
2014-06-17  1:25 ` David Rientjes
2014-06-17  1:25   ` David Rientjes
2014-06-17  2:02   ` Guenter Roeck
2014-06-17  2:02     ` Guenter Roeck
2014-06-24  4:35 ` Benjamin Herrenschmidt
2014-06-24  4:35   ` Benjamin Herrenschmidt
2014-06-24  5:05   ` Guenter Roeck
2014-06-24  5:05     ` Guenter Roeck
2014-06-24  5:34     ` Benjamin Herrenschmidt
2014-06-24  5:34       ` Benjamin Herrenschmidt
2014-06-24  6:01       ` Guenter Roeck [this message]
2014-06-24  6:01         ` Guenter Roeck
2014-06-24  6:38         ` Benjamin Herrenschmidt
2014-06-24  6:38           ` Benjamin Herrenschmidt
2014-06-25  7:53         ` Geert Uytterhoeven
2014-06-25  7:53           ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53A91449.6010701@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.