From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752810AbbETLZq (ORCPT ); Wed, 20 May 2015 07:25:46 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:45993 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751418AbbETLZo (ORCPT ); Wed, 20 May 2015 07:25:44 -0400 From: Xie XiuQi To: , , , , CC: , , Subject: [PATCH] mce: fix fail to set 'monarchtimeout' via boot option Date: Wed, 20 May 2015 19:22:23 +0800 Message-ID: <1432120943-25028-1-git-send-email-xiexiuqi@huawei.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.100.166] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I use "mce=1,10000000" in cmdline to change the monarch timeout, but it does not work. The cause is that get_option() has parsed the ',' already, we need not to check the ',' again. -- get_option(): read an int from an option string; if available accept a subsequent comma as well. Return values: 0 - no int in string 1 - int found, no subsequent comma 2 - int found including a subsequent comma 3 - hyphen found to denote a range Cc: # 2.6.32+ Signed-off-by: Xie XiuQi --- arch/x86/kernel/cpu/mcheck/mce.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 2a2bb91..46ca8e7 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -2020,11 +2020,8 @@ static int __init mcheck_enable(char *str) else if (!strcmp(str, "bios_cmci_threshold")) cfg->bios_cmci_threshold = true; else if (isdigit(str[0])) { - get_option(&str, &(cfg->tolerant)); - if (*str == ',') { - ++str; + if (get_option(&str, &(cfg->tolerant) == 2) get_option(&str, &(cfg->monarch_timeout)); - } } else { pr_info("mce argument %s ignored. Please use /sys\n", str); return 0; -- 1.8.3.1