public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: David Rientjes <rientjes@google.com>
Cc: <linux-kernel@vger.kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, <x86@kernel.org>
Subject: Re: [PATCH] x86: fix two sparse warnings in early boot string handling
Date: Wed, 12 Feb 2014 17:29:49 -0500	[thread overview]
Message-ID: <52FBF5DD.3030407@windriver.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1402121357450.27082@chino.kir.corp.google.com>

On 14-02-12 05:00 PM, David Rientjes wrote:
> On Wed, 12 Feb 2014, Paul Gortmaker wrote:
> 
>> Actually no v2 pending.  The original v1 patch was/is correct as-is.
>>
>> While x86-64 defconfig passed, it turns out that both strcmp and strstr
>> have to stay, else we will get this on i386 allyesconfig builds:
>>
>> arch/x86/boot/compressed/eboot.o: In function `handle_cmdline_files.isra.5.constprop.6':
>> eboot.c:(.text+0x4cf): undefined reference to `strstr'
>> eboot.c:(.text+0x601): undefined reference to `strstr'
>> make[2]: *** [arch/x86/boot/compressed/vmlinux] Error 1
>>
> 
> 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.

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

But that prototype is not associated with the early boot
string.c support.  Those prototypes are in boot.h -- where
my 1st patch added the strstr one to be consistent with
all the other early boot string.c functions.  Is it clear now?

> 
>> arch/x86/boot/edd.o: In function `query_edd':
>> arch/x86/boot/edd.c:136: undefined reference to `strcmp'
>> arch/x86/boot/edd.c:136: undefined reference to `strcmp'
>> arch/x86/boot/edd.c:140: undefined reference to `strcmp'
>> arch/x86/boot/edd.c:142: undefined reference to `strcmp'
>> make[1]: *** [arch/x86/boot/setup.elf] Error 1
>>
>> So my gut feeling was right after all.  ;)
>>
> 
> I'm not sure what strcmp has to do with this.

Per the earlier mail, and you suggestion about removal of
anything unused, this demonstrated that strcmp was also being
used and hence could not be removed either.

Paul.

  reply	other threads:[~2014-02-12 22:34 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 [this message]
2014-02-12 23:14               ` David Rientjes
2014-02-12 23:31                 ` H. Peter Anvin
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=52FBF5DD.3030407@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.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