public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Alan Bartlett <ajb.stxsl@googlemail.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: fix IO APIC resource allocation error message
Date: Fri, 20 Mar 2009 20:23:23 +0100	[thread overview]
Message-ID: <20090320192323.GG6224@elte.hu> (raw)
In-Reply-To: <200903202012.41344.bzolnier@gmail.com>


* Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:

> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] x86: fix IO APIC resource allocation error message
> 
> Impact: fix incorrect error message
> 
> - IO APIC resource allocation error message contains one too many "be".
> 
> - Print the error message iff there are IO APICs in the system.
> 
> Cc: Alan Bartlett <ajb.stxsl@googlemail.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> ---
> I've seen this error message for some time on my x86-32 laptop...
> 
>  arch/x86/kernel/io_apic.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Index: b/arch/x86/kernel/io_apic.c
> ===================================================================
> --- a/arch/x86/kernel/io_apic.c
> +++ b/arch/x86/kernel/io_apic.c
> @@ -4150,9 +4150,9 @@ static int __init ioapic_insert_resource
>  	int i;
>  	struct resource *r = ioapic_resources;
>  
> -	if (!r) {
> +	if (!r && nr_ioapics > 0) {
>  		printk(KERN_ERR
> -		       "IO APIC resources could be not be allocated.\n");
> +		       "IO APIC resources couldn't be allocated.\n");
>  		return -1;
>  	}

looks good, but there's one weirdness:

so if nr_ioapics == 0 && !r we'll drop into this codepath:

        for (i = 0; i < nr_ioapics; i++) {
                insert_resource(&iomem_resource, r);
                r++;
        }

        return 0;

we survive the loop by luck, and then return 0 - which we'll survive 
too but still it's a bit unexpected and hence fragile.

So i think we should rather add a standalone:

	if (nr_ioapics > 0)
  		printk(KERN_ERR

check to the printk only. That wont affect the remaining code flow.

	Ingo

  reply	other threads:[~2009-03-20 19:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-20 19:12 [PATCH] x86: fix IO APIC resource allocation error message Bartlomiej Zolnierkiewicz
2009-03-20 19:23 ` Ingo Molnar [this message]
2009-03-20 20:00   ` Bartlomiej Zolnierkiewicz
2009-03-20 20:03     ` [tip:x86/apic] " Bartlomiej Zolnierkiewicz
2009-03-20 19:33 ` [PATCH] " Cyrill Gorcunov
2009-03-20 20:02   ` Bartlomiej Zolnierkiewicz
2009-03-20 20:09     ` Cyrill Gorcunov
2009-03-20 20:27       ` Bartlomiej Zolnierkiewicz
2009-03-20 20:36         ` Cyrill Gorcunov

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=20090320192323.GG6224@elte.hu \
    --to=mingo@elte.hu \
    --cc=ajb.stxsl@googlemail.com \
    --cc=bzolnier@gmail.com \
    --cc=linux-kernel@vger.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