From: "H. Peter Anvin" <hpa@zytor.com>
To: David Rientjes <rientjes@google.com>,
Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
x86@kernel.org, Matt Fleming <matt@console-pimps.org>
Subject: Re: [PATCH] x86: fix two sparse warnings in early boot string handling
Date: Wed, 12 Feb 2014 15:31:05 -0800 [thread overview]
Message-ID: <52FC0439.7020508@zytor.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1402121508430.20539@chino.kir.corp.google.com>
On 02/12/2014 03:14 PM, David Rientjes wrote:
> On Wed, 12 Feb 2014, Paul Gortmaker wrote:
>
>>> This means there is a strstr() prototype that is visible to
>>> drivers/firmware/efi/efi-stub-helper.c but fails at linkage because you've
>>> removed the definition.
>>
>> Yes, because you suggested removal when you said, in what is
>> now deleted context text:
>>
>> "I don't see why you can't remove strstr() in
>> arch/x86/boot/string.c entirely. What breaks?"
>>
>> The above answers your question. The eboot.c breaks. So
>> we can't remove strstr.
>>
>
> Thanks.
>
>>> So, again, why would you add a duplicate
>>> prototype with your patch?
>>
>> I'm sure there is an implicit path to <linux/string.h>
>> which allows eboot.c to see a prototype and hence compile.
>>
>
> Nope, linux/string.h only declares the prototype when
> #ifndef __HAVE_ARCH_STRSTR and the 32-bit x86 declaration in
> include/asm/string_32.h properly does #define __HAVE_ARCH_STRSTR.
>
> There's also no #include ordering issue here since linux/string.h does
> #include <asm/string.h> first.
>
> If you had a real problem here, the build would break. So I'll renew my
> original objection: I don't think it's acceptable to add unneeded
> prototypes because sparse doesn't understand this.
>
The real answer IMO ought to be that since arch/x86/boot/string.c is now
used separately from boot.h (eboot.c which includes efi-stub-helper.c
does *not* include boot.h) we may have to move those string functions
into a separate header file.
Matt, do you have any opinions here?
I don't think it is appropriate to leave these warnings in the code
"just because". We have too many live warnings, some of which are real
bugs, and we need to encourage people to address them instead of leaving
them lost in the noise.
-hpa
next prev parent reply other threads:[~2014-02-12 23:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 18:33 [PATCH] x86: fix two sparse warnings in early boot string handling Paul Gortmaker
2014-02-11 22:26 ` David Rientjes
2014-02-12 2:00 ` Paul Gortmaker
2014-02-12 2:23 ` David Rientjes
2014-02-12 14:57 ` Paul Gortmaker
2014-02-12 15:49 ` Paul Gortmaker
2014-02-12 22:00 ` David Rientjes
2014-02-12 22:29 ` Paul Gortmaker
2014-02-12 23:14 ` David Rientjes
2014-02-12 23:31 ` H. Peter Anvin [this message]
2014-02-13 10:31 ` Matt Fleming
2014-02-13 14:01 ` H. Peter Anvin
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=52FC0439.7020508@zytor.com \
--to=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@console-pimps.org \
--cc=mingo@redhat.com \
--cc=paul.gortmaker@windriver.com \
--cc=rientjes@google.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox