selftests/resctrl: Move CAT/CMT test global vars to function they are used in
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 17 Jul 2023 13:15:05 +0000 (16:15 +0300)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 25 Jul 2023 14:53:59 +0000 (08:53 -0600)
commit85b73447a44cd215815464a0981604e177384192
tree34d624843d8a5100b8eeef93728e94f0f28c463a
parent8ee592a638fc246958acdb543acb42e76a72c5aa
selftests/resctrl: Move CAT/CMT test global vars to function they are used in

CAT and CMT tests have count_of_bits, long_mask, cbm_mask, and
cache_size global variables that can be moved into the sole using
function.

Make the global variables local variables of the relevant function to
scope them better.

While at it, move cache_size initialization into the declaration line.

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/cat_test.c
tools/testing/selftests/resctrl/cmt_test.c