CC: kbuild-all(a)lists.01.org BCC: lkp(a)intel.com CC: linux-kernel(a)vger.kernel.org TO: Daniel Lezcano CC: 0day robot CC: Junwen Wu From: kernel test robot drivers/thermal/thermal_sysfs.c:792:22-23: WARNING opportunity for max() drivers/thermal/thermal_sysfs.c:791:22-23: 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: Daniel Lezcano Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://github.com/intel-lab-lkp/linux/commits/UPDATE-20220508-232600/Zhang-Rui/thermal-thermal_stats-skip-broken-trans_table/20220419-165035 head: a9158ddd9f2a97e356583d0bdb81c4e6822e6ad7 commit: a9158ddd9f2a97e356583d0bdb81c4e6822e6ad7 thermal/core: change mm alloc method to avoid kernel warning :::::: branch date: 3 hours ago :::::: commit date: 3 hours ago Please take the patch only if it's a positive warning. Thanks! drivers/thermal/thermal_sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -788,8 +788,8 @@ static int find_show_state( int *nums, i int i, min = INT_MAX, max = 0; for( i = 0; i < numsSize; ++i ) { - min = nums[i] < min ? nums[i] : min; - max = nums[i] > max ? nums[i] : max; + min = min(nums[i], min); + max = max(nums[i], max); } int l = min, r = max, mid, cnt = 0; while( l < r )