]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/resctrl: Fix compilation issues for other global variables
authorFenghua Yu <fenghua.yu@intel.com>
Wed, 17 Mar 2021 02:22:37 +0000 (02:22 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 May 2021 06:37:24 +0000 (08:37 +0200)
commita4ab5bbe53e98530ad7c2c1ae92e541571ab6fc7
treed45e68839211db824c12bccafb1dc5a7e0677054
parent1a762b0bbc8ab376f2eb8c434bd7c76ab47b04ad
selftests/resctrl: Fix compilation issues for other global variables

[ Upstream commit 896016d2ad051811ff9c9c087393adc063322fbc ]

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: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/resctrl/resctrl.h