lkml.org 
[lkml]   [2009]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 3/7] x86: fix alloc_mptable

fix the condition checking.

[ Impact: make alloc_mptable working ]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
arch/x86/kernel/mpparse.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

Index: linux-2.6/arch/x86/kernel/mpparse.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/mpparse.c
+++ linux-2.6/arch/x86/kernel/mpparse.c
@@ -873,21 +873,24 @@ inline void __init check_irq_src(struct
static int check_slot(unsigned long mpc_new_phys, unsigned long mpc_new_length,
int count)
{
+ int ret = 0;
+
if (!mpc_new_phys) {
- pr_info("No spare slots, try to append...take your risk, "
+ pr_warning("No spare slots, try to append...take your risk, "
"new mpc_length %x\n", count);
} else {
- if (count <= mpc_new_length)
+ if (count <= mpc_new_length) {
pr_info("No spare slots, try to append..., "
"new mpc_length %x\n", count);
- else {
+ ret = 1;
+ } else {
pr_err("mpc_new_length %lx is too small\n",
mpc_new_length);
- return -1;
+ ret = -1;
}
}

- return 0;
+ return ret;
}

static int __init replace_intsrc_all(struct mpc_table *mpc,
@@ -946,7 +949,7 @@ static int __init replace_intsrc_all(st
} else {
struct mpc_intsrc *m = (struct mpc_intsrc *)mpt;
count += sizeof(struct mpc_intsrc);
- if (!check_slot(mpc_new_phys, mpc_new_length, count))
+ if (check_slot(mpc_new_phys, mpc_new_length, count) < 0)
goto out;
assign_to_mpc_intsrc(&mp_irqs[i], m);
mpc->length = count;

\
 
 \ /
  Last update: 2009-05-06 19:11    [W:0.135 / U:7.792 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site