* [jlawall:for-5.12 1/5] arch/arm64/kernel/cpufeature.c:705:12-13: WARNING opportunity for max()
@ 2021-04-29 18:06 kernel test robot
2021-04-29 18:06 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-04-29 18:06 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1045 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: 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
config: arm64-randconfig-c024-20210429 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
cocci warnings: (new ones prefixed by >>)
>> arch/arm64/kernel/cpufeature.c:705:12-13: WARNING opportunity for max()
>> arch/arm64/kernel/cpufeature.c:698:12-13: WARNING opportunity for min()
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 39797 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] coccinelle: misc: fix minmax.cocci warnings
2021-04-29 18:06 [jlawall:for-5.12 1/5] arch/arm64/kernel/cpufeature.c:705:12-13: WARNING opportunity for max() kernel test robot
@ 2021-04-29 18:06 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-04-29 18:06 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 2018 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Will Deacon <will@kernel.org>
CC: Suzuki K Poulose <suzuki.poulose@arm.com>
CC: Anshuman Khandual <anshuman.khandual@arm.com>
CC: Marc Zyngier <maz@kernel.org>
CC: Mark Rutland <mark.rutland@arm.com>
CC: Amit Daniel Kachhap <amit.kachhap@arm.com>
CC: linux-arm-kernel(a)lists.infradead.org
From: kernel test robot <lkp@intel.com>
arch/arm64/kernel/cpufeature.c:705:12-13: WARNING opportunity for max()
arch/arm64/kernel/cpufeature.c:698:12-13: WARNING opportunity for min()
Check for opencoded min(), max() implementations.
Generated patches sometimes require adding a cast to fix compile warning.
Warnings/patches scope intentionally limited to a function body.
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>
---
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
Please take the patch only if it's a positive warning. Thanks!
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();
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-29 18:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-29 18:06 [jlawall:for-5.12 1/5] arch/arm64/kernel/cpufeature.c:705:12-13: WARNING opportunity for max() kernel test robot
2021-04-29 18:06 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.