lkml.org 
[lkml]   [2003]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: arch/i386/kernel/mpparse.c warning fixes
William Lee Irwin III writes:
>> - if (m->mpc_apicid > MAX_APICS) {
>> + if (MAX_APICS - m->mpc_apicid <= 0) {
>> printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n",
>> m->mpc_apicid, MAX_APICS);
>> --num_processors;

On Thu, May 22, 2003 at 06:07:43PM +0200, mikpe@csd.uu.se wrote:
> Eeew. Whatever the original problem is, this "fix" is just too
> obscure and ugly.

m->mpc_apicid is an 8-bit type; MAX_APICS can be 256. The above fix
properly compares two integral expressions of equal width.

Also, as MAX_APICS-1 is reserved for the broadcast physical APIC ID
(it's 0xF for serial APIC and 0xFF for xAPIC) the small semantic change
here is correct.


-- wli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site