From patchwork Tue Aug 8 09:16:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 13346390 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7E0FC001B0 for ; Tue, 8 Aug 2023 16:45:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233428AbjHHQpi (ORCPT ); Tue, 8 Aug 2023 12:45:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233319AbjHHQoj (ORCPT ); Tue, 8 Aug 2023 12:44:39 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6897B16BEA; Tue, 8 Aug 2023 08:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691510170; x=1723046170; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AeU9lpwdIgg6JAGy78XCxFAm43MZcs3KmWVwRImfAe0=; b=U3K7xplWsUTOpjXOQ8lTEMmLiWQx+BXH0NUyighRKQb/HEYoKORI0rNo TkMcZrvy1QZW4Kpo/ypvDpqCZ/bOEgAVmleiOV4/XfbYvc/pN3zFXL5zb QRhmLyECnx+MR9v7kajyZkBbW1r5psq2h32DDS7Hf8iXJZTWJP3oqyd7E 9CDXhRCeaONYi0aVE2LJE4zwu8t16SSaARZbtElxCw3/Pmd0jMXkRVYzH SVIcUSWTJ7z4oZrJDKECcfgEo5zirpQrBmYgMQrId1/wvO6qg7JxWH32w NZowpYmtzEwKZTdqVbh58Cn+2MniAyNUZVS8zOvkkVCdPEUkK6bEdx8pT w==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="437097954" X-IronPort-AV: E=Sophos;i="6.01,263,1684825200"; d="scan'208";a="437097954" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2023 02:17:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="977776964" X-IronPort-AV: E=Sophos;i="6.01,263,1684825200"; d="scan'208";a="977776964" Received: from mtofeni-mobl.ger.corp.intel.com (HELO ijarvine-mobl2.ger.corp.intel.com) ([10.252.48.21]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2023 02:17:04 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: Shuah Khan , linux-kselftest@vger.kernel.org, Shuah Khan , Reinette Chatre , Maciej Wieczor-Retman , Fenghua Yu , linux-kernel@vger.kernel.org Cc: Shaopeng Tan , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 6/7] selftests/resctrl: remove ben_count variable Date: Tue, 8 Aug 2023 12:16:24 +0300 Message-Id: <20230808091625.12760-7-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230808091625.12760-1-ilpo.jarvinen@linux.intel.com> References: <20230808091625.12760-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org ben_count is only used to write the terminator for the list. It is enough to use i from the loop so no need for another variable. Remove ben_count variable as it is not needed. Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/resctrl_tests.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c index 74a10abeb01d..81c2ed299e6f 100644 --- a/tools/testing/selftests/resctrl/resctrl_tests.c +++ b/tools/testing/selftests/resctrl/resctrl_tests.c @@ -176,13 +176,12 @@ int main(int argc, char **argv) bool has_ben = false, mbm_test = true, mba_test = true, cmt_test = true; int c, cpu_no = 1, argc_new = argc, i, no_of_bits = 0; const char *benchmark_cmd[BENCHMARK_ARGS]; - int ben_ind, ben_count, tests = 0; + int ben_ind, tests = 0; bool cat_test = true; for (i = 0; i < argc; i++) { if (strcmp(argv[i], "-b") == 0) { ben_ind = i + 1; - ben_count = argc - ben_ind; argc_new = ben_ind - 1; has_ben = true; break; @@ -259,7 +258,7 @@ int main(int argc, char **argv) /* Extract benchmark command from command line. */ for (i = 0; i < argc - ben_ind; i++) benchmark_cmd[i] = argv[i + ben_ind]; - benchmark_cmd[ben_count] = NULL; + benchmark_cmd[i] = NULL; } else { /* If no benchmark is given by "-b" argument, use fill_buf. */ benchmark_cmd[0] = "fill_buf";