From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gnuweeb.org (Postfix) with ESMTPS id C16477E353 for ; Thu, 31 Mar 2022 23:33:39 +0000 (UTC) Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=YBHegTHv; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648769619; x=1680305619; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=9Dr5EsPbdamJdDCvHeSKKp4r3DAHf14EoM5Xx8tkhak=; b=YBHegTHvZc2lCxXR4VWvBc0766Kys67aRbsgaaoVxP/1DlyEYD9PeE5G UYfPsxhNJz1pZoCStFh0eeO+EYxgRCxncjQ8BDSIcG5ktpKNrc91pNyxU /at5AmIjVh74MA4ochC+cZWG3UvxX4tJDhcvEfu7U2KSm2zhtokMAeHqA e68DXevbcc2D6InPLOalk8urxMu4lsSb4bRKosqq3gUwZsEXw+jUfB/do IAzD5GP7Jk66dzWQFfOaeeV4hyeeG7vnVBl6LpFu/OaLXDlA2p1MtYv80 ob2JiFFTW6utq3PbwXIDRrhSWcQd1pMK4LFy1Dt3Y7ssn4OOXZ8x88mIP Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10303"; a="258818852" X-IronPort-AV: E=Sophos;i="5.90,225,1643702400"; d="scan'208";a="258818852" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2022 16:33:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,225,1643702400"; d="scan'208";a="566928715" Received: from lkp-server02.sh.intel.com (HELO 3231c491b0e2) ([10.239.97.151]) by orsmga008.jf.intel.com with ESMTP; 31 Mar 2022 16:33:34 -0700 Received: from kbuild by 3231c491b0e2 with local (Exim 4.95) (envelope-from ) id 1na4II-0000km-8x; Thu, 31 Mar 2022 23:33:34 +0000 Date: Fri, 1 Apr 2022 07:33:03 +0800 From: kernel test robot To: Jens Axboe Cc: kbuild-all@lists.01.org, GNU/Weeb Mailing List , linux-kernel@vger.kernel.org Subject: [PATCH] net: fix err_cast.cocci warnings Message-ID: References: <202204010757.kWpiiHMi-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202204010757.kWpiiHMi-lkp@intel.com> List-Id: From: kernel test robot net/socket.c:1571:9-16: WARNING: ERR_CAST can be used with sock Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) Generated by: scripts/coccinelle/api/err_cast.cocci Fixes: 3af464ccde38 ("net: add __sys_socket_file()") Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://github.com/ammarfaizi2/linux-block axboe/linux-block/sock-nolock head: 8698873371093e22f708c2cf3a31f4dc2caab84f commit: 3af464ccde389a5df95af3e221d098ac34d4606f [7/9] net: add __sys_socket_file() :::::: branch date: 4 hours ago :::::: commit date: 4 hours ago net/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/socket.c +++ b/net/socket.c @@ -1568,7 +1568,7 @@ struct file *__sys_socket_direct(int fam sock = __sys_socket_create(family, type, protocol); if (IS_ERR(sock)) - return ERR_PTR(PTR_ERR(sock)); + return ERR_CAST(sock); flags = type & ~SOCK_TYPE_MASK; if (SOCK_NONBLOCK != O_NONBLOCK && (flags & SOCK_NONBLOCK))