aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/resctrl/resctrl_tests.c
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2023-09-04 12:53:38 +0300
committerShuah Khan <skhan@linuxfoundation.org>2023-10-13 14:29:02 -0600
commit149ff729538aabaa85c44dc58a45fb99798e5e7e (patch)
tree6f1bb217d846904e63c298b5e148d5b53d5baf65 /tools/testing/selftests/resctrl/resctrl_tests.c
parentselftests/resctrl: Make benchmark command const and build it with pointers (diff)
downloadwireguard-linux-149ff729538aabaa85c44dc58a45fb99798e5e7e.tar.xz
wireguard-linux-149ff729538aabaa85c44dc58a45fb99798e5e7e.zip
selftests/resctrl: Remove ben_count variable
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 <ilpo.jarvinen@linux.intel.com> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: "Wieczor-Retman, Maciej" <maciej.wieczor-retman@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/resctrl/resctrl_tests.c')
-rw-r--r--tools/testing/selftests/resctrl/resctrl_tests.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
index 89edde416f07..48e5afb1530c 100644
--- a/tools/testing/selftests/resctrl/resctrl_tests.c
+++ b/tools/testing/selftests/resctrl/resctrl_tests.c
@@ -172,7 +172,7 @@ 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;
char *span_str = NULL;
bool cat_test = true;
int ret;
@@ -180,7 +180,6 @@ int main(int argc, char **argv)
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;
@@ -265,7 +264,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";