From patchwork Tue Apr 6 20:49:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 12185869 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54F2DC433B4 for ; Tue, 6 Apr 2021 20:49:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E6306121E for ; Tue, 6 Apr 2021 20:49:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347330AbhDFUty (ORCPT ); Tue, 6 Apr 2021 16:49:54 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:46914 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347311AbhDFUto (ORCPT ); Tue, 6 Apr 2021 16:49:44 -0400 IronPort-HdrOrdr: A9a23:T/2/YqoHNVVlZF548FcJGCUaV5rreYIsi2QD101hICF9WMqeisyogbAnxQb54QxhOk0ItNicNMC7Kk/02oVy5eAqV4uKeCnDlC+WIJp57Y3kqgeQeBHW0uJGz69vf+xfJbTLbGRStsrx7AmmH9tI+rDuzImTmezcw31xJDsFV4hc6W5CZjqzLld7X01vC5Y/CfOnhvZvln6QPU4aacm2HRA+MtTrrdejrv3bXSI= X-IronPort-AV: E=Sophos;i="5.82,201,1613430000"; d="scan'208";a="377918733" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Apr 2021 22:49:26 +0200 Date: Tue, 6 Apr 2021 22:49:26 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Jan Kara , Amir Goldstein cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kbuild-all@lists.01.org, Denis Efremov Subject: [PATCH] inotify: fix minmax.cocci warnings Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org From: kernel test robot Opportunity for min(). Generated by: scripts/coccinelle/misc/minmax.cocci Fixes: 8636e3295ce3 ("coccinelle: misc: add minmax script") CC: Denis Efremov Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.12 head: cbc8ed0b4f7eeb782c153ec88d6d20bc0f0ca3a7 commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/4] coccinelle: misc: add minmax script :::::: branch date: 2 days ago :::::: commit date: 2 weeks ago 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 @@ -382,7 +382,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,