Commit 5e3e4f1a authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Shuah Khan

selftests/resctrl: Remove unnecessary startptr global from fill_buf

fill_buf stores buffer pointer into global variable startptr that is
only used in fill_cache().

Remove startptr as global variable, the local variable in fill_cache()
is enough to keep the pointer.
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Tested-by: default avatarBabu Moger <babu.moger@amd.com>
Tested-by: default avatarShaopeng Tan (Fujitsu) <tan.shaopeng@fujitsu.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 326baed2
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#define PAGE_SIZE (4 * 1024) #define PAGE_SIZE (4 * 1024)
#define MB (1024 * 1024) #define MB (1024 * 1024)
static unsigned char *startptr;
static void sb(void) static void sb(void)
{ {
#if defined(__i386) || defined(__x86_64) #if defined(__i386) || defined(__x86_64)
...@@ -147,7 +145,6 @@ static int fill_cache(size_t buf_size, int memflush, int op, char *resctrl_val) ...@@ -147,7 +145,6 @@ static int fill_cache(size_t buf_size, int memflush, int op, char *resctrl_val)
if (!start_ptr) if (!start_ptr)
return -1; return -1;
startptr = start_ptr;
end_ptr = start_ptr + buf_size; end_ptr = start_ptr + buf_size;
/* Flush the memory before using to avoid "cache hot pages" effect */ /* Flush the memory before using to avoid "cache hot pages" effect */
...@@ -159,7 +156,7 @@ static int fill_cache(size_t buf_size, int memflush, int op, char *resctrl_val) ...@@ -159,7 +156,7 @@ static int fill_cache(size_t buf_size, int memflush, int op, char *resctrl_val)
else else
ret = fill_cache_write(start_ptr, end_ptr, resctrl_val); ret = fill_cache_write(start_ptr, end_ptr, resctrl_val);
free(startptr); free(start_ptr);
if (ret) { if (ret) {
printf("\n Error in fill cache read/write...\n"); printf("\n Error in fill cache read/write...\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment