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,USER_AGENT_GIT autolearn=unavailable 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 68AF1C1550D for ; Sun, 7 Mar 2021 14:56:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4994B64F5F for ; Sun, 7 Mar 2021 14:56:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232030AbhCGOzg (ORCPT ); Sun, 7 Mar 2021 09:55:36 -0500 Received: from mga17.intel.com ([192.55.52.151]:5870 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231567AbhCGOzK (ORCPT ); Sun, 7 Mar 2021 09:55:10 -0500 IronPort-SDR: XFat2q7c3gVl0VXfoJWPUcJ0hLfSIkCUYiAVOlxJ+Re8SKzZEav6eTyiGnKXrrua1rWj3oGfZt pHSmYWpCQEvA== X-IronPort-AV: E=McAfee;i="6000,8403,9916"; a="167813493" X-IronPort-AV: E=Sophos;i="5.81,230,1610438400"; d="scan'208";a="167813493" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2021 06:55:09 -0800 IronPort-SDR: YF0Mkivbt7yCpLHyfaKMGLcYWfQwmQk2opJp5k5/5DFOGFbEc3Wqfwn2BI+7rjU9maT0a4z4Er Y996gZIl4bpQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,230,1610438400"; d="scan'208";a="437189101" Received: from otcwcpicx3.sc.intel.com ([172.25.55.73]) by FMSMGA003.fm.intel.com with ESMTP; 07 Mar 2021 06:55:09 -0800 From: Fenghua Yu To: "Shuah Khan" , "Tony Luck" , "Reinette Chatre" , "Babu Moger" Cc: "linux-kselftest" , "linux-kernel" , Fenghua Yu Subject: [PATCH v5 06/21] selftests/resctrl: Fix missing options "-n" and "-p" Date: Sun, 7 Mar 2021 14:54:47 +0000 Message-Id: <20210307145502.2916364-7-fenghua.yu@intel.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210307145502.2916364-1-fenghua.yu@intel.com> References: <20210307145502.2916364-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 --- Change Log: v5: - Move from v4's patch 9 to this patch as the fix patch should be first (Shuah). 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.1