Skip to content

Commit bf68c71

Browse files
ij-intelshuahkh
authored andcommitted
selftests/resctrl: Remove test type checks from cat_val()
cat_val() is only used during CAT test but it checks for test type. Remove test type checks and the unused else branch from cat_val(). Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Tested-by: Babu Moger <babu.moger@amd.com> Tested-by: Shaopeng Tan (Fujitsu) <tan.shaopeng@fujitsu.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 3dad011 commit bf68c71

File tree

1 file changed

+20
-27
lines changed
  • tools/testing/selftests/resctrl

1 file changed

+20
-27
lines changed

tools/testing/selftests/resctrl/cache.c

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -230,38 +230,31 @@ int cat_val(struct resctrl_val_param *param)
230230
if (ret)
231231
return ret;
232232

233-
if (!strncmp(resctrl_val, CAT_STR, sizeof(CAT_STR)))
234-
initialize_llc_perf();
233+
initialize_llc_perf();
235234

236235
/* Test runs until the callback setup() tells the test to stop. */
237236
while (1) {
238-
if (!strncmp(resctrl_val, CAT_STR, sizeof(CAT_STR))) {
239-
ret = param->setup(param);
240-
if (ret == END_OF_TESTS) {
241-
ret = 0;
242-
break;
243-
}
244-
if (ret < 0)
245-
break;
246-
ret = reset_enable_llc_perf(bm_pid, param->cpu_no);
247-
if (ret)
248-
break;
249-
250-
if (run_fill_buf(param->span, memflush, operation, true)) {
251-
fprintf(stderr, "Error-running fill buffer\n");
252-
ret = -1;
253-
goto pe_close;
254-
}
255-
256-
sleep(1);
257-
ret = measure_cache_vals(param, bm_pid);
258-
if (ret)
259-
goto pe_close;
260-
261-
close(fd_lm);
262-
} else {
237+
ret = param->setup(param);
238+
if (ret == END_OF_TESTS) {
239+
ret = 0;
263240
break;
264241
}
242+
if (ret < 0)
243+
break;
244+
ret = reset_enable_llc_perf(bm_pid, param->cpu_no);
245+
if (ret)
246+
break;
247+
248+
if (run_fill_buf(param->span, memflush, operation, true)) {
249+
fprintf(stderr, "Error-running fill buffer\n");
250+
ret = -1;
251+
goto pe_close;
252+
}
253+
254+
sleep(1);
255+
ret = measure_cache_vals(param, bm_pid);
256+
if (ret)
257+
goto pe_close;
265258
}
266259

267260
return ret;

0 commit comments

Comments
 (0)