* drivers/thunderbolt/property.c:501:12-13: WARNING opportunity for min()
@ 2022-02-16 16:21 kernel test robot
2022-02-16 16:13 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2022-02-16 16:21 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c5d9ae265b105d9a67575fb67bd4650a6fc08e25
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
date: 10 months ago
:::::: branch date: 21 hours ago
:::::: commit date: 10 months ago
config: x86_64-randconfig-c002-20220214 (https://download.01.org/0day-ci/archive/20220217/202202170042.PCOyRvCo-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 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 >>)
>> drivers/thunderbolt/property.c:501:12-13: WARNING opportunity for min()
--
>> drivers/acpi/thermal.c:425:43-44: 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] coccinelle: misc: fix minmax.cocci warnings
2022-02-16 16:21 drivers/thunderbolt/property.c:501:12-13: WARNING opportunity for min() kernel test robot
@ 2022-02-16 16:13 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-02-16 16:13 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1835 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Zhang Rui <rui.zhang@intel.com>
CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>
CC: Len Brown <lenb@kernel.org>
CC: linux-acpi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
drivers/acpi/thermal.c:425:43-44: 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
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/torvalds/linux.git master
head: c5d9ae265b105d9a67575fb67bd4650a6fc08e25
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 21 hours ago
:::::: commit date: 10 months ago
Please take the patch only if it's a positive warning. Thanks!
drivers/acpi/thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -422,10 +422,8 @@ static int acpi_thermal_trips_update(str
* the next higher trip point
*/
tz->trips.active[i - 1].temperature =
- (tz->trips.active[i - 2].temperature <
- celsius_to_deci_kelvin(act) ?
- tz->trips.active[i - 2].temperature :
- celsius_to_deci_kelvin(act));
+ min(tz->trips.active[i - 2].temperature,
+ celsius_to_deci_kelvin(act));
break;
} else {
tz->trips.active[i].temperature = tmp;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-16 16:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16 16:21 drivers/thunderbolt/property.c:501:12-13: WARNING opportunity for min() kernel test robot
2022-02-16 16:13 ` [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.