Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp293330rwb; Thu, 11 Aug 2022 01:21:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR6uffnBleegPtsGOWX8nidRShctGDmu75uYjQsaic7r1koyeL6pbHt9ABWXuI9akqvdpKTF X-Received: by 2002:a05:6402:4507:b0:43b:b8df:571d with SMTP id ez7-20020a056402450700b0043bb8df571dmr30040394edb.230.1660206079720; Thu, 11 Aug 2022 01:21:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660206079; cv=none; d=google.com; s=arc-20160816; b=soz2sIzH0G+iSABw8DIGZ0RLdO5TJ++5cLsvd91A0JGkHCanIDTTGrm1odT5jZtB56 ynT2nh7osDs0l0i0eHLKFNJ1UQ0KD6SMXE9itWk7efq70tQvwdly7YoqQzR7BrmfF5Nr AvS+bKyyXg+E4U8FjU4Elb1+tnAgU4WcUIk9LPOfwC5iLdHQ3HoNtLHVCsBEq3wFwVYl CBciNJloAVvvRh0vqNkRGNSG06c5OurP1wlXTv4fbo4TrUNUuMwkyurDkL7VLdIN+lVV 0Lz9d51l02R2LO9sxyekOokUP57wPRn+bTV95gte+Mxk2RUKXj6JQcxfSodsySc4eSkf C1OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=Hhrl8c/DPZ1Ll5/PmFFBjhHJNcDsaJKQAxDUC1Wa0HA=; b=CRSXBuKVXKR/u1c6r8XTUACzpccugjGS864Wtcpeiek5UpFqCTsjZ7jD0prlZZTKX6 JvsVPU/QS067ESc7qh7RZ2Gy4kknhGxED6ouchyHLMVPEYOi6GZ+qxhABRVewbZ7a5zj mg0gfzRlPZT4B7sxbkIUDxhfJjGPRZoold0AtFCSug6tEtZUa/GNNlPqiLXdnW/J38Ox dV+TwSa4ulXl8BEQUbxTvXMJdHyudsROY74ll/C514BokZ9Sv712g4yKAD0HU8FnZxbm NMW0sxfK6i1ilKVvpK85bDXSHGcBMEt3/97YHPL8iZYy7+WDnkoiKgKhLIqmJeS6j2fG XlIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cm3-20020a0564020c8300b0043e1d52fd9fsi11510347edb.594.2022.08.11.01.20.53; Thu, 11 Aug 2022 01:21:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234066AbiHKH5I (ORCPT + 99 others); Thu, 11 Aug 2022 03:57:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229786AbiHKH5F (ORCPT ); Thu, 11 Aug 2022 03:57:05 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D05FB1CB29; Thu, 11 Aug 2022 00:57:04 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 3486F1E80D76; Thu, 11 Aug 2022 15:55:02 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nH0mPoTT1dVg; Thu, 11 Aug 2022 15:54:59 +0800 (CST) Received: from localhost.localdomain.localdomain (unknown [219.141.250.2]) (Authenticated sender: chunchao@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 511BA1E80CE3; Thu, 11 Aug 2022 15:54:59 +0800 (CST) From: Zhang chunchao To: axboe@kernel.dk, asml.silence@gmail.com Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@nfschina.com, Zhang chunchao Subject: [PATCH] Modify the return value ret to EOPNOTSUPP when initialized to reduce repeated assignment of errno Date: Thu, 11 Aug 2022 15:56:38 +0800 Message-Id: <20220811075638.36450-1-chunchao@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove unnecessary initialization assignments. Signed-off-by: Zhang chunchao --- io_uring/io_uring.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index b54218da075c..8c267af06401 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -3859,14 +3859,13 @@ SYSCALL_DEFINE4(io_uring_register, unsigned int, fd, unsigned int, opcode, void __user *, arg, unsigned int, nr_args) { struct io_ring_ctx *ctx; - long ret = -EBADF; + long ret = -EOPNOTSUPP; struct fd f; f = fdget(fd); if (!f.file) return -EBADF; - ret = -EOPNOTSUPP; if (!io_is_uring_fops(f.file)) goto out_fput; -- 2.18.2