Skip to content

Commit f6334b1

Browse files
intel-lab-lkpctmarinas
authored andcommitted
arm64: cpufeatures: use min and max
Use min and max to make the effect more clear. Generated by: scripts/coccinelle/misc/minmax.cocci CC: Denis Efremov <[email protected]> Reported-by: kernel test robot <[email protected]> Signed-off-by: kernel test robot <[email protected]> Signed-off-by: Julia Lawall <[email protected]> Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2104292246300.16899@hadrien [[email protected]: include <linux/minmax.h> explicitly] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 8533d5b commit f6334b1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/arm64/kernel/cpufeature.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
#include <linux/sort.h>
6969
#include <linux/stop_machine.h>
7070
#include <linux/types.h>
71+
#include <linux/minmax.h>
7172
#include <linux/mm.h>
7273
#include <linux/cpu.h>
7374
#include <linux/kasan.h>
@@ -695,14 +696,14 @@ static s64 arm64_ftr_safe_value(const struct arm64_ftr_bits *ftrp, s64 new,
695696
ret = ftrp->safe_val;
696697
break;
697698
case FTR_LOWER_SAFE:
698-
ret = new < cur ? new : cur;
699+
ret = min(new, cur);
699700
break;
700701
case FTR_HIGHER_OR_ZERO_SAFE:
701702
if (!cur || !new)
702703
break;
703704
fallthrough;
704705
case FTR_HIGHER_SAFE:
705-
ret = new > cur ? new : cur;
706+
ret = max(new, cur);
706707
break;
707708
default:
708709
BUG();

0 commit comments

Comments
 (0)