Commit 896016d2 authored by Fenghua Yu's avatar Fenghua Yu Committed by Shuah Khan

selftests/resctrl: Fix compilation issues for other global variables

Reinette reported following compilation issue on Fedora 32, gcc version
10.1.1

/usr/bin/ld: resctrl_tests.o:<src_dir>/resctrl.h:65: multiple definition
of `bm_pid'; cache.o:<src_dir>/resctrl.h:65: first defined here

Other variables are ppid, tests_run, llc_occup_path, is_amd. Compiler
isn't happy because these variables are defined globally in two .c files
but are not declared as extern.

To fix issues for the global variables, declare them as extern.

Chang Log:
- Split this patch from v4's patch 1 (Shuah).
Reported-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Tested-by: default avatarBabu Moger <babu.moger@amd.com>
Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 8236c51d
......@@ -62,11 +62,11 @@ struct resctrl_val_param {
int (*setup)(int num, ...);
};
pid_t bm_pid, ppid;
int tests_run;
extern pid_t bm_pid, ppid;
extern int tests_run;
char llc_occup_path[1024];
bool is_amd;
extern char llc_occup_path[1024];
extern bool is_amd;
bool check_resctrlfs_support(void);
int filter_dmesg(void);
......
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