CC: [email protected]
BCC: [email protected]
TO: Roman Gushchin <[email protected]>

From: kernel test robot <[email protected]>

mm/shrinker_debug.c:120:21-22: 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: 44d87615ffe3 ("mm: shrinkers: add scan interface for shrinker debugfs")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree:   https://github.com/rgushchin/linux.git shrinker.5
head:   be0b94668aac83e3bc04f73b06ad0b309bd51477
commit: 44d87615ffe3c376b23b6087b0b1fa02a3f86b62 [7/9] mm: shrinkers: add scan 
interface for shrinker debugfs
:::::: branch date: 15 hours ago
:::::: commit date: 2 days ago

Please take the patch only if it's a positive warning. Thanks!

 mm/shrinker_debug.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/shrinker_debug.c
+++ b/mm/shrinker_debug.c
@@ -117,7 +117,7 @@ static ssize_t shrinker_debugfs_scan_wri
        struct mem_cgroup *memcg = NULL;
        int nid;
        char kbuf[72];
-       int read_len = size < (sizeof(kbuf) - 1) ? size : (sizeof(kbuf) - 1);
+       int read_len = min(size, sizeof(kbuf) - 1);
        ssize_t ret;
 
        if (copy_from_user(kbuf, buf, read_len))
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to