[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230418114506.46788-21-ilpo.jarvinen@linux.intel.com>
Date: Tue, 18 Apr 2023 14:45:02 +0300
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: linux-kselftest@...r.kernel.org,
Reinette Chatre <reinette.chatre@...el.com>,
Fenghua Yu <fenghua.yu@...el.com>,
Shuah Khan <shuah@...nel.org>, linux-kernel@...r.kernel.org
Cc: Shaopeng Tan <tan.shaopeng@...fujitsu.com>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Subject: [PATCH v2 20/24] selftests/resctrl: Move CAT/CMT test global vars to func they are used
CAT and CMT tests have count_of_bits, long_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.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
---
tools/testing/selftests/resctrl/cat_test.c | 7 +++----
tools/testing/selftests/resctrl/cmt_test.c | 7 +++----
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/tools/testing/selftests/resctrl/cat_test.c b/tools/testing/selftests/resctrl/cat_test.c
index ae21e656cf6e..ef3ba22bdde5 100644
--- a/tools/testing/selftests/resctrl/cat_test.c
+++ b/tools/testing/selftests/resctrl/cat_test.c
@@ -17,10 +17,6 @@
#define MAX_DIFF_PERCENT 4
#define MAX_DIFF 1000000
-static int count_of_bits;
-static unsigned long long_mask;
-static unsigned long cache_size;
-
/*
* Change schemata. Write schemata to specified
* con_mon grp, mon_grp in resctrl FS.
@@ -95,6 +91,9 @@ int cat_perf_miss_val(int cpu_no, int n, char *cache_type)
{
unsigned long l_mask, l_mask_1;
int ret, pipefd[2], sibling_cpu_no;
+ unsigned long cache_size;
+ unsigned long long_mask;
+ int count_of_bits;
char pipe_message;
cache_size = 0;
diff --git a/tools/testing/selftests/resctrl/cmt_test.c b/tools/testing/selftests/resctrl/cmt_test.c
index 087378a775ee..6adee08661e7 100644
--- a/tools/testing/selftests/resctrl/cmt_test.c
+++ b/tools/testing/selftests/resctrl/cmt_test.c
@@ -16,10 +16,6 @@
#define MAX_DIFF 2000000
#define MAX_DIFF_PERCENT 15
-static int count_of_bits;
-static unsigned long long_mask;
-static unsigned long cache_size;
-
static int cmt_setup(struct resctrl_val_param *p)
{
/* Run NUM_OF_RUNS times */
@@ -74,6 +70,9 @@ void cmt_test_cleanup(void)
int cmt_resctrl_val(int cpu_no, int n, char **benchmark_cmd)
{
+ unsigned long cache_size;
+ unsigned long long_mask;
+ int count_of_bits;
int ret;
cache_size = 0;
--
2.30.2
Powered by blists - more mailing lists