From patchwork Wed May 6 17:07:07 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 22078 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n46H8irV018444 for ; Wed, 6 May 2009 17:08:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758980AbZEFRIj (ORCPT ); Wed, 6 May 2009 13:08:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757405AbZEFRIj (ORCPT ); Wed, 6 May 2009 13:08:39 -0400 Received: from hera.kernel.org ([140.211.167.34]:38626 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754459AbZEFRIh (ORCPT ); Wed, 6 May 2009 13:08:37 -0400 Received: from [10.6.76.26] (sca-ea-fw-1.Sun.COM [192.18.43.225]) (authenticated bits=0) by hera.kernel.org (8.14.2/8.13.8) with ESMTP id n46H7F7c004990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 May 2009 17:07:15 GMT Message-ID: <4A01C3BB.1000609@kernel.org> Date: Wed, 06 May 2009 10:07:07 -0700 From: Yinghai Lu User-Agent: Thunderbird 2.0.0.19 (X11/20081227) MIME-Version: 1.0 To: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , Jesse Barnes , Len Brown CC: "linux-kernel@vger.kernel.org" , linux-pci@vger.kernel.org, ACPI Devel Maling List Subject: [PATCH 3/7] x86: fix alloc_mptable References: <4A01C35C.7060207@kernel.org> In-Reply-To: <4A01C35C.7060207@kernel.org> X-Virus-Scanned: ClamAV 0.93.3/9333/Wed May 6 03:55:26 2009 on hera.kernel.org X-Virus-Status: Clean Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org fix the condition checking. [ Impact: make alloc_mptable working ] Signed-off-by: Yinghai Lu --- arch/x86/kernel/mpparse.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;