Skip to content

Commit ad669ec

Browse files
committed
x86/mce: Remove function-local cpus variables
Use num_online_cpus() directly. No functional changes. Signed-off-by: Borislav Petkov <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent cd5e0d1 commit ad669ec

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

arch/x86/kernel/cpu/mce/core.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,6 @@ static atomic_t global_nwo;
985985
static int mce_start(int *no_way_out)
986986
{
987987
int order;
988-
int cpus = num_online_cpus();
989988
u64 timeout = (u64)mca_cfg.monarch_timeout * NSEC_PER_USEC;
990989

991990
if (!timeout)
@@ -1002,7 +1001,7 @@ static int mce_start(int *no_way_out)
10021001
/*
10031002
* Wait for everyone.
10041003
*/
1005-
while (atomic_read(&mce_callin) != cpus) {
1004+
while (atomic_read(&mce_callin) != num_online_cpus()) {
10061005
if (mce_timed_out(&timeout,
10071006
"Timeout: Not all CPUs entered broadcast exception handler")) {
10081007
atomic_set(&global_nwo, 0);
@@ -1066,14 +1065,11 @@ static int mce_end(int order)
10661065
atomic_inc(&mce_executing);
10671066

10681067
if (order == 1) {
1069-
/* CHECKME: Can this race with a parallel hotplug? */
1070-
int cpus = num_online_cpus();
1071-
10721068
/*
10731069
* Monarch: Wait for everyone to go through their scanning
10741070
* loops.
10751071
*/
1076-
while (atomic_read(&mce_executing) <= cpus) {
1072+
while (atomic_read(&mce_executing) <= num_online_cpus()) {
10771073
if (mce_timed_out(&timeout,
10781074
"Timeout: Monarch CPU unable to finish machine check processing"))
10791075
goto reset;

0 commit comments

Comments
 (0)