Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2483743pxj; Mon, 10 May 2021 04:11:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPWiP1NAyLjYqmELHtEJwfJKYfV9T/5906rtqPKndxHp25DwFn1eURPE/jFrh1wy9XH5sv X-Received: by 2002:a92:d287:: with SMTP id p7mr14938864ilp.165.1620645110663; Mon, 10 May 2021 04:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645110; cv=none; d=google.com; s=arc-20160816; b=gq0QQ6fjY8xX8svERLoBERPuHehTHzzT6d2HWbovPM+J4aW/l3r6KcZt5qvA/7hxzq RW3lm+S9c1p7N+Hq+PzyCv7JXeZq8ZEKf/1U7mDNh4eW553Nb3vbAy2b4rwxkTzDzYbc BcVjcaB742mOo5h8hzuQxyACn2Yh05BsmzP0ldBTp5rTfjIcL4bWQRsU2skKpBj9E7CD 6daq/LP/5EMHpKujTz9LoIa+UuPPQOFU/z97PHVjZ/6UJ0D2D3sUC/jnN71h6JF8viMR Gq4R7P+Bas4nwN2wkYHxWalP9AW9zz19wvfUYo4QokowElCfbKTwflK6RVYX6q/iy/4i YXtQ== 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=li4qAOGXJmy6coHNRAlocN1PqTPqrlE3cbEZ7PFcVuQDv1g+E1GAPy2kzs9YNML/3/ ez6Yd+hKOwG/ESkBk+2/WNFlkLUSm8wlWQdvgIJzV6Suu+G/+V2vm5TjoJjhxM+2Hc+P 3fKMDs2pyVb/NfszZ9R0c221M0RlGAsswHbLCTYw63kYIA/KVlNOn+OKX4NB2YMeVYC5 jIzzxK3Pz3lIpm6JzAGPZeOO8LeF84onWhvJOU8TeIEenmbk3OLz/e/h6n1EAVDVtaQo DADsfyJyl1GnsVEiiClphBbGy9VIhrDtT209IgjNcGOc34KEF+DWZYQt/blv0RFmBFaZ 8rCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t8X9vSnm; 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 c22si5115307ioo.82.2021.05.10.04.11.38; Mon, 10 May 2021 04:11:50 -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=t8X9vSnm; 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 S236890AbhEJLK4 (ORCPT + 99 others); Mon, 10 May 2021 07:10:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:32906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233510AbhEJKuK (ORCPT ); Mon, 10 May 2021 06:50:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 641436194D; Mon, 10 May 2021 10:39:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643145; bh=+wccCjzA60YTh/aYIuzJXLgDe3FSQk+9jQJ1eYJtsCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t8X9vSnma7UDqS284GfyadUSL7LwgiVL86DM7iOzVdcuBYc0E9wzczD5RkKrScBfH 4niohhigBETgtnc2uQGfTYZwwk1Le5/PIeb2OVv0Tot/6RJQNUPd7iOmN/wqrxb3KN JIlgbk8zQ6vUuzez0AO9PdJ5AnQnKnTjnQv7Bvuc= 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.10 161/299] selftests/resctrl: Fix missing options "-n" and "-p" Date: Mon, 10 May 2021 12:19:18 +0200 Message-Id: <20210510102010.276959842@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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