Skip to content

Commit 5e3e4f1

Browse files
ij-intelshuahkh
authored andcommitted
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: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Tested-by: Babu Moger <[email protected]> Tested-by: Shaopeng Tan (Fujitsu) <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 326baed commit 5e3e4f1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tools/testing/selftests/resctrl/fill_buf.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
#define PAGE_SIZE (4 * 1024)
2323
#define MB (1024 * 1024)
2424

25-
static unsigned char *startptr;
26-
2725
static void sb(void)
2826
{
2927
#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)
147145
if (!start_ptr)
148146
return -1;
149147

150-
startptr = start_ptr;
151148
end_ptr = start_ptr + buf_size;
152149

153150
/* 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)
159156
else
160157
ret = fill_cache_write(start_ptr, end_ptr, resctrl_val);
161158

162-
free(startptr);
159+
free(start_ptr);
163160

164161
if (ret) {
165162
printf("\n Error in fill cache read/write...\n");

0 commit comments

Comments
 (0)