selftests/resctrl: Remove duplicated preparation for span arg
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 17 Jul 2023 13:14:59 +0000 (16:14 +0300)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 25 Jul 2023 14:53:23 +0000 (08:53 -0600)
When no benchmark_cmd is given, benchmark_cmd[1] is set to span in
main(). There's no need to do it again in run_mba_test().

Remove the duplicated preparation for span argument into
benchmark_cmd[1] from run_mba_test(). After this, the has_ben and span
arguments to run_mba_test() can be removed.

Co-developed-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
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>
tools/testing/selftests/resctrl/resctrl_tests.c

index 3a65dacb441e7d5d8fd9f583de5c3d26c14494ce..bf0cadab36b0854a4d4a859dcb1f3bfd9ccc5f7a 100644 (file)
@@ -99,8 +99,7 @@ umount:
        umount_resctrlfs();
 }
 
-static void run_mba_test(bool has_ben, char **benchmark_cmd, size_t span,
-                        int cpu_no, char *bw_report)
+static void run_mba_test(char **benchmark_cmd, int cpu_no, char *bw_report)
 {
        int res;
 
@@ -117,8 +116,6 @@ static void run_mba_test(bool has_ben, char **benchmark_cmd, size_t span,
                goto umount;
        }
 
-       if (!has_ben)
-               sprintf(benchmark_cmd[1], "%zu", span);
        res = mba_schemata_change(cpu_no, bw_report, benchmark_cmd);
        ksft_test_result(!res, "MBA: schemata change\n");
 
@@ -299,7 +296,7 @@ int main(int argc, char **argv)
                run_mbm_test(has_ben, benchmark_cmd, span, cpu_no, bw_report);
 
        if (mba_test)
-               run_mba_test(has_ben, benchmark_cmd, span, cpu_no, bw_report);
+               run_mba_test(benchmark_cmd, cpu_no, bw_report);
 
        if (cmt_test)
                run_cmt_test(has_ben, benchmark_cmd, cpu_no);