Skip to content

Commit dfc4e3f

Browse files
mrutland-armMarc Zyngier
authored andcommitted
arm64: cpufeature: reorder cpus_have_{const, final}_cap()
In a subsequent patch we'll modify cpus_have_const_cap() to call cpus_have_final_cap(), and hence we need to define cpus_have_final_cap() first. To make subsequent changes easier to follow, this patch reorders the two without making any other changes. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Acked-by: Will Deacon <will@kernel.org> Cc: David Brazdil <dbrazdil@google.com> Cc: Marc Zyngier <maz@kernel.org> Cc: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20201026134931.28246-3-mark.rutland@arm.com
1 parent e9a33ca commit dfc4e3f

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

arch/arm64/include/asm/cpufeature.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,35 +428,35 @@ static __always_inline bool __cpus_have_const_cap(int num)
428428
}
429429

430430
/*
431-
* Test for a capability, possibly with a runtime check.
431+
* Test for a capability without a runtime check.
432432
*
433-
* Before capabilities are finalized, this behaves as cpus_have_cap().
433+
* Before capabilities are finalized, this will BUG().
434434
* After capabilities are finalized, this is patched to avoid a runtime check.
435435
*
436436
* @num must be a compile-time constant.
437437
*/
438-
static __always_inline bool cpus_have_const_cap(int num)
438+
static __always_inline bool cpus_have_final_cap(int num)
439439
{
440440
if (system_capabilities_finalized())
441441
return __cpus_have_const_cap(num);
442442
else
443-
return cpus_have_cap(num);
443+
BUG();
444444
}
445445

446446
/*
447-
* Test for a capability without a runtime check.
447+
* Test for a capability, possibly with a runtime check.
448448
*
449-
* Before capabilities are finalized, this will BUG().
449+
* Before capabilities are finalized, this behaves as cpus_have_cap().
450450
* After capabilities are finalized, this is patched to avoid a runtime check.
451451
*
452452
* @num must be a compile-time constant.
453453
*/
454-
static __always_inline bool cpus_have_final_cap(int num)
454+
static __always_inline bool cpus_have_const_cap(int num)
455455
{
456456
if (system_capabilities_finalized())
457457
return __cpus_have_const_cap(num);
458458
else
459-
BUG();
459+
return cpus_have_cap(num);
460460
}
461461

462462
static inline void cpus_set_cap(unsigned int num)

0 commit comments

Comments
 (0)