From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============1249239340462043034==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] FROMLIST: mm: multi-gen LRU: fix minmax.cocci warnings Date: Thu, 23 Jun 2022 07:32:12 +0800 Message-ID: In-Reply-To: <202206230702.VM9WZtOQ-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============1249239340462043034== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org BCC: lkp(a)intel.com TO: cros-kernel-buildreports(a)googlegroups.com From: kernel test robot mm/vmscan.c:3268:14-15: WARNING opportunity for max() 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: Yu Zhao Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://android.googlesource.com/kernel/common android13-5.15 head: 96f47dce39cbeca32c76a3ef784ab4b72100215e commit: a1537a68c5010553002f62fad91c7c0c886c73d8 [6/19] FROMLIST: mm: multi= -gen LRU: minimal implementation :::::: branch date: 4 hours ago :::::: commit date: 9 weeks ago Please take the patch only if it's a positive warning. Thanks! mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3265,7 +3265,7 @@ static long get_nr_evictable(struct lruv else *need_aging =3D false; = - return total > 0 ? total : 0; + return max(total, 0); } = static void age_lruvec(struct lruvec *lruvec, struct scan_control *sc) --===============1249239340462043034==--