From patchwork Wed Aug 23 17:34:30 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: 9918105 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 B3C95600C5 for ; Wed, 23 Aug 2017 17:38:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E4FF28534 for ; Wed, 23 Aug 2017 17:38:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93319289D5; Wed, 23 Aug 2017 17:38:39 +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 29E9728534 for ; Wed, 23 Aug 2017 17:38:39 +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 1dkZZS-0002Sh-6w; Wed, 23 Aug 2017 17:36:02 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkZZQ-0002O1-Ou for xen-devel@lists.xenproject.org; Wed, 23 Aug 2017 17:36:00 +0000 Received: from [193.109.254.147] by server-8.bemta-6.messagelabs.com id 59/49-09901-00DBD995; Wed, 23 Aug 2017 17:36:00 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRWlGSWpSXmKPExsVyuP0Ov+7/PXM jDY5+1rT4vmUykwOjx+EPV1gCGKNYM/OS8isSWDP61u1mLNjCVfH56G32BsbZHF2MnBwSAkYS byf+Y+pi5OIQEljIKDHp9GV2kASbgKrEhuunWEFsEQEliXurJjOB2MwC7hIb3zWxgNjCAkUSy 2dcBouzANWfvb2bGcTmFTCV2P3iHwvEAnmJjgOTwWxOoPjVJe/AbCEBE4kDu36wTGDkXsDIsI pRozi1qCy1SNfQTC+pKDM9oyQ3MTNH19DATC83tbg4MT01JzGpWC85P3cTI9C/DECwg/H+xoB DjJIcTEqivOtWzI0U4kvKT6nMSCzOiC8qzUktPsQow8GhJMF7dzdQTrAoNT21Ii0zBxhoMGkJ Dh4lEd5bIGne4oLE3OLMdIjUKUZFKXHeSpCEAEgiozQPrg0W3JcYZaWEeRmBDhHiKUgtys0sQ ZV/xSjOwagkzPsFZApPZl4J3PRXQIuZgBZPOjEHZHFJIkJKqoExytuwyDVLnMV3uarHF0tnPw 7We72t6fKmaoW/15S+bXAUt33kfvGT8qSy2f33Oldlml3w898hJM+06tjP5inLNU+L8wvz6+r XNdhExh1/0lqUc/mMon1t2flL+lsn7/gyR3vp2pCM1uqPidb/F+vbNcx9uieEVeGci4fKzD9/ FOremPk8ClJiKc5INNRiLipOBABh7pudaQIAAA== X-Env-Sender: jgross@suse.com X-Msg-Ref: server-4.tower-27.messagelabs.com!1503509759!112330233!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 49472 invoked from network); 23 Aug 2017 17:35:59 -0000 Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by server-4.tower-27.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 23 Aug 2017 17:35:59 -0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 45782AF57; Wed, 23 Aug 2017 17:34:59 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Wed, 23 Aug 2017 19:34:30 +0200 Message-Id: <20170823173446.24801-38-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 , Kevin Tian Subject: [Xen-devel] [PATCH v4 37/53] xen/drivers/passthrough/vtd/quirks.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/drivers/passthrough/vtd/quirks.c to indicate whether the parameter value was parsed successfully. Cc: Kevin Tian Signed-off-by: Juergen Gross Acked-by: Wei Liu Acked-by: Kevin Tian --- xen/drivers/passthrough/vtd/quirks.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c index d6dd671dbf..d6db862678 100644 --- a/xen/drivers/passthrough/vtd/quirks.c +++ b/xen/drivers/passthrough/vtd/quirks.c @@ -247,9 +247,10 @@ void vtd_ops_postamble_quirk(struct iommu* iommu) } } -static void __init parse_snb_timeout(const char *s) +static int __init parse_snb_timeout(const char *s) { int t; + const char *q = NULL; t = parse_bool(s, NULL); if ( t < 0 ) @@ -259,13 +260,13 @@ static void __init parse_snb_timeout(const char *s) else if ( strcmp(s, "cap") == 0 ) t = SNB_IGD_TIMEOUT; else - t = strtoul(s, NULL, 0); + t = strtoul(s, &q, 0); } else t = t ? SNB_IGD_TIMEOUT_LEGACY : 0; snb_igd_timeout = MILLISECS(t); - return; + return (q && *q) ? -EINVAL : 0; } custom_param("snb_igd_quirk", parse_snb_timeout);