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 <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>
#define PAGE_SIZE (4 * 1024)
#define MB (1024 * 1024)
-static unsigned char *startptr;
-
static void sb(void)
{
#if defined(__i386) || defined(__x86_64)
if (!start_ptr)
return -1;
- startptr = start_ptr;
end_ptr = start_ptr + buf_size;
/* Flush the memory before using to avoid "cache hot pages" effect */
else
ret = fill_cache_write(start_ptr, end_ptr, resctrl_val);
- free(startptr);
+ free(start_ptr);
if (ret) {
printf("\n Error in fill cache read/write...\n");