From patchwork Wed Aug 23 17:34:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 9918075 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E2F6F608BA for ; Wed, 23 Aug 2017 17:38:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB624289E6 for ; Wed, 23 Aug 2017 17:38:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA359289F8; Wed, 23 Aug 2017 17:38:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 94C9D289E6 for ; Wed, 23 Aug 2017 17:38:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkZYT-0008WN-9R; Wed, 23 Aug 2017 17:35:01 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkZYQ-0008JJ-Ls for xen-devel@lists.xenproject.org; Wed, 23 Aug 2017 17:34:58 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id 54/15-02181-2CCBD995; Wed, 23 Aug 2017 17:34:58 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRWlGSWpSXmKPExsVyuP0Ov+7BPXM jDdq361p83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBmf/+5iLHjPXXFl8m/mBsY+ri5GTg4JASOJ txP/MYHYQgILGSW6D+mA2GwCqhIbrp9iBbFFBJQk7q2aDFTDxcEs8JhJYsau5WANwgKJEis2P GEEsVmAGnrvbGIHsXkFTCX+7F/GCrFAXqLjwGQWEJsTKH51yTsWiGUmEgd2/WCZwMi9gJFhFa N6cWpRWWqRroleUlFmekZJbmJmjq6hgbFebmpxcWJ6ak5iUrFecn7uJkagdxmAYAdj4xenQ4y SHExKorzrVsyNFOJLyk+pzEgszogvKs1JLT7EKMPBoSTBm7cbKCdYlJqeWpGWmQMMM5i0BAeP kghvCkiat7ggMbc4Mx0idYpRUUqc980uoIQASCKjNA+uDRbalxhlpYR5GYEOEeIpSC3KzSxBl X/FKM7BqCTM6wIyniczrwRu+iugxUxAiyedmAOyuCQRISXVwBi2PdzWPSOYi60gxFjXi6c9fu mP3kWm0i2pRaKuv95NleK25Slelv6zPyVJ4+hypUPHq7a/YOubl/kycdW2M3LbFqy2/3/77ib mDQtYU4K+nW+ewmt/dqZm2o8J+4x+Wh8+FLdoirGGcVxxcLZew3Lrcxtt3DTu1KVoL9r8f8mf oBWxIuLWRUosxRmJhlrMRcWJAOvhDUxoAgAA X-Env-Sender: jgross@suse.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1503509697!111298396!1 X-Originating-IP: [195.135.220.15] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 38074 invoked from network); 23 Aug 2017 17:34:57 -0000 Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by server-3.tower-31.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 23 Aug 2017 17:34:57 -0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6FF41AF4D; Wed, 23 Aug 2017 17:34:57 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Wed, 23 Aug 2017 19:34:21 +0200 Message-Id: <20170823173446.24801-29-jgross@suse.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170823173446.24801-1-jgross@suse.com> References: <20170823173446.24801-1-jgross@suse.com> Cc: Juergen Gross , Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Jan Beulich Subject: [Xen-devel] [PATCH v4 28/53] xen/common/memory.c: let custom parameter parsing routines return errno X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Modify the custom parameter parsing routines in: xen/common/memory.c to indicate whether the parameter value was parsed successfully. Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu Signed-off-by: Juergen Gross Acked-by: Wei Liu Acked-by: Jan Beulich --- V3: - cosmetic changes (Jan Beulich) --- xen/common/memory.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/common/memory.c b/xen/common/memory.c index b2066db07e..26da6050f6 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -55,7 +55,8 @@ static unsigned int __read_mostly hwdom_max_order = CONFIG_HWDOM_MAX_ORDER; #ifdef HAS_PASSTHROUGH static unsigned int __read_mostly ptdom_max_order = CONFIG_PTDOM_MAX_ORDER; #endif -static void __init parse_max_order(const char *s) + +static int __init parse_max_order(const char *s) { if ( *s != ',' ) domu_max_order = simple_strtoul(s, &s, 0); @@ -67,6 +68,8 @@ static void __init parse_max_order(const char *s) if ( *s == ',' && *++s != ',' ) ptdom_max_order = simple_strtoul(s, &s, 0); #endif + + return *s ? -EINVAL : 0; } custom_param("memop-max-order", parse_max_order);