From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DFC6C64E8A for ; Mon, 30 Nov 2020 20:21:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F18AC2074A for ; Mon, 30 Nov 2020 20:21:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730153AbgK3UVa (ORCPT ); Mon, 30 Nov 2020 15:21:30 -0500 Received: from mga12.intel.com ([192.55.52.136]:21506 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730108AbgK3UV2 (ORCPT ); Mon, 30 Nov 2020 15:21:28 -0500 IronPort-SDR: 6fBHOflCuO3aSutqgG86okkOtorQu/fxG/fXvOh1L3hJwAqPU65ZS9gTsBZRsg/U+33ppZkkcg H1QAA0PJ+sDg== X-IronPort-AV: E=McAfee;i="6000,8403,9821"; a="151959427" X-IronPort-AV: E=Sophos;i="5.78,382,1599548400"; d="scan'208";a="151959427" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2020 12:20:32 -0800 IronPort-SDR: 0qSYqaOLv0hc2AAQDpKf/hTcr704SMqp1K7pL1YMbbFvBIgajUer+OlOSwBalH+Eg7uEM2dsuf Qs1a9dK58EmA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,382,1599548400"; d="scan'208";a="480793786" Received: from otcwcpicx6.sc.intel.com ([172.25.55.29]) by orsmga004.jf.intel.com with ESMTP; 30 Nov 2020 12:20:32 -0800 From: Fenghua Yu To: "Shuah Khan" , "Tony Luck" , "Reinette Chatre" , "David Binderman" , "Babu Moger" , "James Morse" , "Ravi V Shankar" Cc: "linux-kernel" , Fenghua Yu Subject: [PATCH v4 09/17] selftests/resctrl: Fix missing options "-n" and "-p" Date: Mon, 30 Nov 2020 20:20:02 +0000 Message-Id: <20201130202010.178373-10-fenghua.yu@intel.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201130202010.178373-1-fenghua.yu@intel.com> References: <20201130202010.178373-1-fenghua.yu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Fenghua Yu --- 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 0e036dbf5d17..ef09e0ef2366 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.29.2