Skip to content

Commit 149ff72

Browse files
ij-intelshuahkh
authored andcommitted
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>
1 parent e33cb57 commit 149ff72

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

tools/testing/selftests/resctrl/resctrl_tests.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,14 @@ int main(int argc, char **argv)
172172
bool has_ben = false, mbm_test = true, mba_test = true, cmt_test = true;
173173
int c, cpu_no = 1, argc_new = argc, i, no_of_bits = 0;
174174
const char *benchmark_cmd[BENCHMARK_ARGS];
175-
int ben_ind, ben_count, tests = 0;
175+
int ben_ind, tests = 0;
176176
char *span_str = NULL;
177177
bool cat_test = true;
178178
int ret;
179179

180180
for (i = 0; i < argc; i++) {
181181
if (strcmp(argv[i], "-b") == 0) {
182182
ben_ind = i + 1;
183-
ben_count = argc - ben_ind;
184183
argc_new = ben_ind - 1;
185184
has_ben = true;
186185
break;
@@ -265,7 +264,7 @@ int main(int argc, char **argv)
265264
/* Extract benchmark command from command line. */
266265
for (i = 0; i < argc - ben_ind; i++)
267266
benchmark_cmd[i] = argv[i + ben_ind];
268-
benchmark_cmd[ben_count] = NULL;
267+
benchmark_cmd[i] = NULL;
269268
} else {
270269
/* If no benchmark is given by "-b" argument, use fill_buf. */
271270
benchmark_cmd[0] = "fill_buf";

0 commit comments

Comments
 (0)