Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1460280 > unrolled thread

Re: [PATCH 2/2] x86, ACPI: Fix the wrong assignment when Handle apic/x2apic entries

Started byIngo Molnar <mingo@kernel.org>
First post2016-08-11 10:50 +0200
Last post2016-08-11 16:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 2/2] x86, ACPI: Fix the wrong assignment when Handle  apic/x2apic entries Ingo Molnar <mingo@kernel.org> - 2016-08-11 10:50 +0200
    Re: [PATCH 2/2] x86, ACPI: Fix the wrong assignment when Handle  apic/x2apic entries Baoquan He <bhe@redhat.com> - 2016-08-11 16:30 +0200

#1460280 — Re: [PATCH 2/2] x86, ACPI: Fix the wrong assignment when Handle apic/x2apic entries

FromIngo Molnar <mingo@kernel.org>
Date2016-08-11 10:50 +0200
SubjectRe: [PATCH 2/2] x86, ACPI: Fix the wrong assignment when Handle apic/x2apic entries
Message-ID<s4TQC-1tP-41@gated-at.bofh.it>
* Baoquan He <bhe@redhat.com> wrote:

> On 08/10/16 at 02:53pm, Ingo Molnar wrote:
> > 
> > * Baoquan He <bhe@redhat.com> wrote:
> > 
> > > It won't impact the result, we still should fix the code bug.
> > > 
> > > Signed-off-by: Baoquan He <bhe@redhat.com>
> > > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> > > Cc: Len Brown <len.brown@intel.com>
> > > Cc: Pavel Machek <pavel@ucw.cz>
> > > Cc: Thomas Gleixner <tglx@linutronix.de>
> > > Cc: Ingo Molnar <mingo@redhat.com>
> > > Cc: "H. Peter Anvin" <hpa@zytor.com>
> > > Cc: x86@kernel.org
> > > Cc: linux-pm@vger.kernel.org
> > > ---
> > >  arch/x86/kernel/acpi/boot.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
> > > index 90d84c3..2b25d3f 100644
> > > --- a/arch/x86/kernel/acpi/boot.c
> > > +++ b/arch/x86/kernel/acpi/boot.c
> > > @@ -1031,8 +1031,8 @@ static int __init acpi_parse_madt_lapic_entries(void)
> > >  			return ret;
> > >  		}
> > >  
> > > -		x2count = madt_proc[0].count;
> > > -		count = madt_proc[1].count;
> > > +		count = madt_proc[0].count;
> > > +		x2count = madt_proc[1].count;
> > >  	}
> > >  	if (!count && !x2count) {
>           ~~~~~~~~~~~~~~~~~~~~~
> I mean here the value checking won't be impacted by the wrong
> assignment.

Indeed!

Mind putting that into the changelog? Something like:

"By pure accident the bug makes no functional difference, because the only 
 expression where we are using these values is (!count && !x2count), in which
 the variables are interchangeable, but it makes sense to fix the bug 
 nevertheless."

Thanks,

	Ingo

[toc] | [next] | [standalone]


#1460569

FromBaoquan He <bhe@redhat.com>
Date2016-08-11 16:30 +0200
Message-ID<s4Z9E-4XM-1@gated-at.bofh.it>
In reply to#1460280
On 08/11/16 at 10:46am, Ingo Molnar wrote:
> > > > -		count = madt_proc[1].count;
> > > > +		count = madt_proc[0].count;
> > > > +		x2count = madt_proc[1].count;
> > > >  	}
> > > >  	if (!count && !x2count) {
> >           ~~~~~~~~~~~~~~~~~~~~~
> > I mean here the value checking won't be impacted by the wrong
> > assignment.
> 
> Indeed!
> 
> Mind putting that into the changelog? Something like:
> 
> "By pure accident the bug makes no functional difference, because the only 
>  expression where we are using these values is (!count && !x2count), in which
>  the variables are interchangeable, but it makes sense to fix the bug 
>  nevertheless."

Sure, this is much clearer. Will use this and repost. Thanks a lot, will
try to do each post using patch log like this.

Thanks
Baoquan

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web