Commit 05cdeac3 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] arch/i386/kernel/mpparse.c warning fixes

From: William Lee Irwin III <wli@holomorphy.com>

mpc_apicid is a u8, and MAX_APICS can be 256.
parent 2a52198b
...@@ -171,7 +171,7 @@ void __init MP_processor_info (struct mpc_config_processor *m) ...@@ -171,7 +171,7 @@ void __init MP_processor_info (struct mpc_config_processor *m)
num_processors++; num_processors++;
if (m->mpc_apicid > MAX_APICS) { if (MAX_APICS - m->mpc_apicid <= 0) {
printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n", printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n",
m->mpc_apicid, MAX_APICS); m->mpc_apicid, MAX_APICS);
--num_processors; --num_processors;
...@@ -803,7 +803,7 @@ void __init mp_register_lapic ( ...@@ -803,7 +803,7 @@ void __init mp_register_lapic (
struct mpc_config_processor processor; struct mpc_config_processor processor;
int boot_cpu = 0; int boot_cpu = 0;
if (id >= MAX_APICS) { if (MAX_APICS - id <= 0) {
printk(KERN_WARNING "Processor #%d invalid (max %d)\n", printk(KERN_WARNING "Processor #%d invalid (max %d)\n",
id, MAX_APICS); id, MAX_APICS);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment