CC: [email protected] BCC: [email protected] TO: Roman Gushchin <[email protected]>
From: kernel test robot <[email protected]> mm/shrinker_debug.c:122: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: 12f77aac7ef2 ("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.3 head: 12f77aac7ef21be765e90bb8e0b611e6b9085256 commit: 12f77aac7ef21be765e90bb8e0b611e6b9085256 [7/7] mm: shrinkers: add scan interface for shrinker debugfs :::::: branch date: 4 hours ago :::::: commit date: 4 hours 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 @@ -119,7 +119,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]
