All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] FROMLIST: mm: multi-gen LRU: fix minmax.cocci warnings
  2022-06-03  4:44 [android-common:android13-5.15 6/19] mm/vmscan.c:3268:14-15: WARNING opportunity for max() kernel test robot
@ 2022-06-03  4:41 ` kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-06-03  4:41 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1307 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
TO: cros-kernel-buildreports(a)googlegroups.com

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

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 <yuzhao@google.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://android.googlesource.com/kernel/common android13-5.15
head:   78d6de78638b6cf7771a98628648f8b29f6d8cab
commit: a1537a68c5010553002f62fad91c7c0c886c73d8 [6/19] FROMLIST: mm: multi-gen LRU: minimal implementation
:::::: branch date: 5 hours ago
:::::: commit date: 6 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 = false;
 
-	return total > 0 ? total : 0;
+	return max(total, 0);
 }
 
 static void age_lruvec(struct lruvec *lruvec, struct scan_control *sc)

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

* [android-common:android13-5.15 6/19] mm/vmscan.c:3268:14-15: WARNING opportunity for max()
@ 2022-06-03  4:44 kernel test robot
  2022-06-03  4:41 ` [PATCH] FROMLIST: mm: multi-gen LRU: fix minmax.cocci warnings kernel test robot
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2022-06-03  4:44 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 951 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
TO: cros-kernel-buildreports(a)googlegroups.com

tree:   https://android.googlesource.com/kernel/common android13-5.15
head:   78d6de78638b6cf7771a98628648f8b29f6d8cab
commit: a1537a68c5010553002f62fad91c7c0c886c73d8 [6/19] FROMLIST: mm: multi-gen LRU: minimal implementation
:::::: branch date: 5 hours ago
:::::: commit date: 6 weeks ago
config: x86_64-randconfig-c022 (https://download.01.org/0day-ci/archive/20220603/202206031204.MSQ7CcYS-lkp(a)intel.com/config)
compiler: gcc-11 (Debian 11.3.0-1) 11.3.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


cocci warnings: (new ones prefixed by >>)
>> mm/vmscan.c:3268:14-15: WARNING opportunity for max()

Please review and possibly fold the followup patch.

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

* [PATCH] FROMLIST: mm: multi-gen LRU: fix minmax.cocci warnings
  2022-06-22 23:33 [android-common:android13-5.15 6/19] mm/vmscan.c:3268:14-15: WARNING opportunity for max() kernel test robot
@ 2022-06-22 23:32 ` kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-06-22 23:32 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1307 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
TO: cros-kernel-buildreports(a)googlegroups.com

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

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 <yuzhao@google.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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 = false;
 
-	return total > 0 ? total : 0;
+	return max(total, 0);
 }
 
 static void age_lruvec(struct lruvec *lruvec, struct scan_control *sc)

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

end of thread, other threads:[~2022-06-22 23:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03  4:44 [android-common:android13-5.15 6/19] mm/vmscan.c:3268:14-15: WARNING opportunity for max() kernel test robot
2022-06-03  4:41 ` [PATCH] FROMLIST: mm: multi-gen LRU: fix minmax.cocci warnings kernel test robot
2022-06-22 23:33 [android-common:android13-5.15 6/19] mm/vmscan.c:3268:14-15: WARNING opportunity for max() kernel test robot
2022-06-22 23:32 ` [PATCH] FROMLIST: mm: multi-gen LRU: 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.