CC: kbuild-all(a)lists.01.org TO: Denis Efremov CC: Julia Lawall CC: Jan Kara CC: Amir Goldstein CC: linux-fsdevel(a)vger.kernel.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot fs/notify/inotify/inotify_user.c:384:12-13: 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: 5f66f73b9ff4 ("coccinelle: misc: add minmax script") CC: Denis Efremov Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.14 head: f5b3553b5019f22ac668651ea9cddb9fa675ac41 commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 [1/8] coccinelle: misc: add minmax script :::::: branch date: 4 days ago :::::: commit date: 3 weeks ago Please take the patch only if it's a positive warning. Thanks! inotify_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c @@ -381,7 +381,7 @@ static int inotify_add_to_idr(struct idr spin_unlock(idr_lock); idr_preload_end(); - return ret < 0 ? ret : 0; + return min(ret, 0); } static struct inotify_inode_mark *inotify_idr_find_locked(struct fsnotify_group *group,