public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] arm64: cpufeatures: use min and max
@ 2021-04-29 20:50 Julia Lawall
  2021-04-30 11:49 ` Mark Rutland
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Julia Lawall @ 2021-04-29 20:50 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Suzuki K Poulose, Anshuman Khandual,
	Marc Zyngier, Mark Rutland, Amit Daniel Kachhap
  Cc: Denis Efremov, kbuild-all, linux-arm-kernel

From: kernel test robot <lkp@intel.com>

Use min and max to make the effect more clear.

Generated by: scripts/coccinelle/misc/minmax.cocci

Fixes: 8636e3295ce3 ("coccinelle: misc: add minmax script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.12
head:   44e793b89bcfe586730f4c6ce3c66174dc07cb37
commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/5] coccinelle: misc: add minmax script
:::::: branch date: 6 days ago
:::::: commit date: 6 weeks ago

 cpufeature.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -695,14 +695,14 @@ static s64 arm64_ftr_safe_value(const st
 		ret = ftrp->safe_val;
 		break;
 	case FTR_LOWER_SAFE:
-		ret = new < cur ? new : cur;
+		ret = min(new, cur);
 		break;
 	case FTR_HIGHER_OR_ZERO_SAFE:
 		if (!cur || !new)
 			break;
 		fallthrough;
 	case FTR_HIGHER_SAFE:
-		ret = new > cur ? new : cur;
+		ret = max(new, cur);
 		break;
 	default:
 		BUG();

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-30 17:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-29 20:50 [PATCH] arm64: cpufeatures: use min and max Julia Lawall
2021-04-30 11:49 ` Mark Rutland
2021-04-30 17:38 ` Catalin Marinas
2021-04-30 17:40   ` [kbuild-all] " Julia Lawall
2021-04-30 17:56 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox