Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2543500pxj; Mon, 10 May 2021 05:34:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxFWMh+CjLrjXQ1fcdQImAbHCubs28zW1LXp4DojLZXgZPR+y4fqbSwjxvY3uRYC0UTUFv X-Received: by 2002:a05:6402:204c:: with SMTP id bc12mr28855205edb.35.1620650084679; Mon, 10 May 2021 05:34:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620650084; cv=none; d=google.com; s=arc-20160816; b=GBXXFkNI9/pnda3Y8XSWoBM209iVW9JTgfk9vi8bMGPupmTDf9+Oeel6KnyLSiffLS Dlo37ZrAhzPLuoDqQnsnqP4RLNKVvSOM6dqpLu+J/ddyUhpEZMAnqQ3U92c8YqvbcmhP SZ45IC9j5Z9j06jhsHl1yZMhP2Ge15gp02EmKcufzVepT8rOFmd9Q19WaiMnO5d78dmH XRySCVVj6u++0uR5zP0IUKmfAmVh/dVXRrMRdIDZGX0+0OG9y/ZkGblcT7HHnwrpwTBK +e8SOahOKim5VIRspMoDng9Eb12zmv2vjq8SDplEGUKo/XuF+OflZ1mzTqQ75Uv/vkEy Mu6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Fkpn1zB3k+thFPtLTddgFQ90UGcPhMgNHqVUidzBCRA=; b=HTdKyZelcJhwBMtXhBCODpZeCKJ6TjyaJPUEAshF/NdwsuuFamsExaHPBH0FYw7shJ X+1UKjgLSusxpR98AhbwIAZSSulXc+Giu/qGOD1naI71VhjMcUGBoh3dcX3y6nHUN9w9 GJDCCHiq7FHmejuvbSoj5G/rlobeaBjP6dISxXVXZRH0hmmXYjVRHt3x5kE+A3K2o5Wk w4BNcezZ5EB7v34wYaMo0gHebBfDxYALqSsZknwrBGMpFgNUsuaNvirCqOphQ9BtajVU /aR4weGkYebcgKpFWTcTkRMjL75pk2P/wkgRJhdRoI9I2XxwyOkfGVs2byGAWQ8pVK4K nAng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DOTSqp5E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q17si13072549ejn.503.2021.05.10.05.34.20; Mon, 10 May 2021 05:34:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DOTSqp5E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345252AbhEJMWJ (ORCPT + 99 others); Mon, 10 May 2021 08:22:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:45604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236927AbhEJLLA (ORCPT ); Mon, 10 May 2021 07:11:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 24A8061490; Mon, 10 May 2021 11:05:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620644753; bh=+wccCjzA60YTh/aYIuzJXLgDe3FSQk+9jQJ1eYJtsCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DOTSqp5Eris1qNmBsbtJ0CJoaVNFbstUfEe2NaHSo8IUmluamuNRUj8m6/X2ikJ2h VfSvHQAhjBTNd55RBCz8HLh2dl67ckWuN235uvxUQhTppBvvKGzT7FjiAK8ELwbCJG 8V3iClOoLozw7J1LB4Od9M8uk9glUuV4xAw2dpvs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Babu Moger , Fenghua Yu , Shuah Khan , Sasha Levin Subject: [PATCH 5.12 210/384] selftests/resctrl: Fix missing options "-n" and "-p" Date: Mon, 10 May 2021 12:19:59 +0200 Message-Id: <20210510102021.816463520@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102014.849075526@linuxfoundation.org> References: <20210510102014.849075526@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fenghua Yu [ Upstream commit d7af3d0d515cbdf63b6c3398a3c15ecb1bc2bd38 ] resctrl test suite accepts command line arguments (like -b, -t, -n and -p) as documented in the help. But passing -n and -p throws an invalid option error. This happens because -n and -p are missing in the list of characters that getopt() recognizes as valid arguments. Hence, they are treated as invalid options. Fix this by adding them to the list of characters that getopt() recognizes as valid arguments. Please note that the main() function already has the logic to deal with the values passed as part of these arguments and hence no changes are needed there. Tested-by: Babu Moger Signed-off-by: Fenghua Yu Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/resctrl/resctrl_tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c index 4b109a59f72d..ac2269610aa9 100644 --- a/tools/testing/selftests/resctrl/resctrl_tests.c +++ b/tools/testing/selftests/resctrl/resctrl_tests.c @@ -73,7 +73,7 @@ int main(int argc, char **argv) } } - while ((c = getopt(argc_new, argv, "ht:b:")) != -1) { + while ((c = getopt(argc_new, argv, "ht:b:n:p:")) != -1) { char *token; switch (c) { -- 2.30.2