From patchwork Thu Mar 16 18:13:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li zeming X-Patchwork-Id: 69925 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2084687wrd; Tue, 14 Mar 2023 18:48:13 -0700 (PDT) X-Google-Smtp-Source: AK7set+JPKicMlH/ezrszYF7zRcdplKwaybvUrKAg9mojtXrJFtHmL7MYYq0v8zvSxXOUvPChnQM X-Received: by 2002:a17:90b:1b45:b0:23d:c1a:8628 with SMTP id nv5-20020a17090b1b4500b0023d0c1a8628mr8147634pjb.17.1678844893380; Tue, 14 Mar 2023 18:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678844893; cv=none; d=google.com; s=arc-20160816; b=eintH15tGku1cqPwgNccMGbz1bpqsLWrWhXoznuqlS8oCEUVgXkH8aRtCyToiDGf3P f/qXAhKH8/PYnLGrwO3hLl/ZU9zScuOU15YubljV/NeP/mFdCFpTc0EzvbqqK5BKlR5u zXQWH8G7Bm7ku2rez+ybI0OYgsFXuQkoc5Ww8hQcKf/frbwphkN34HdJzpH9lhL1sZen oiovLwsd2dN9ZNfZKNcecv4aWjlQzpTvbW4eYWNKbc2xRz7Yz0A3Sd79kxCC6wCH3yKG mM2/YBVCnkvX9ecdIZsfC1uETyC2suBfspnYAdu7vphzHsUkdOyC5ieN0DPAdd4C5+/c Tf/g== 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=uR9gStWcGkSOtqyTZTnLMHerwq7ja1lTVQAiRupr+S4=; b=0UIiNTCGTP+kLDvz1l7kYkU34EnvUIipkY+JzmE71kplkWASsmTjisWz9+dJ+dCKvd wDJ3p/lIUSkT8fEEP8Yck1nSnTHcboMWJGFTenbiezkkM3r5fqKae7z+EnSY8pAz/glD 7WmMqoVMPyOEro4y9KbznHLgjuKvrTz0XBskmY4VqKwRrkTHo3G8YUGtcR+A/3Htkmts BAeNsHy+6L1InO9EBCd1EkkMDi5EuoTCIPPauMx8vaGGahptJ3/W1299TGTmMZ7em48t 5V99VEWALtoGAbtU6q5/wAtiTRdV67GkLxyr0NVuUNgALlUIXIQXXmZhVpCzdjbp2Ijx wBng== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds14-20020a17090b08ce00b0023431f3e046si337525pjb.13.2023.03.14.18.47.58; Tue, 14 Mar 2023 18:48:13 -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 S230152AbjCOBlt (ORCPT + 99 others); Tue, 14 Mar 2023 21:41:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbjCOBls (ORCPT ); Tue, 14 Mar 2023 21:41:48 -0400 Received: from mail.nfschina.com (unknown [42.101.60.237]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AF2C37B7C; Tue, 14 Mar 2023 18:41:47 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id E44761A00A95; Wed, 15 Mar 2023 09:41:45 +0800 (CST) X-Virus-Scanned: amavisd-new at nfschina.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (localhost.localdomain [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cWTD41PXQbL2; Wed, 15 Mar 2023 09:41:44 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: zeming@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 4E30C1A0091B; Wed, 15 Mar 2023 09:41:44 +0800 (CST) From: Li zeming To: axboe@kernel.dk, asml.silence@gmail.com Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] io_uring: rsrc: Optimize return value variable 'ret' Date: Fri, 17 Mar 2023 02:13:03 +0800 Message-Id: <20230316181303.6583-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=2.3 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_24_48, RCVD_IN_VALIDITY_RPBL,RDNS_NONE,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760396462848438883?= X-GMAIL-MSGID: =?utf-8?q?1760396462848438883?= The function returns here and returns ret directly. It may look better. Signed-off-by: Li zeming --- io_uring/rsrc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index 056f40946ff6..55dc2c505f8a 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -415,11 +415,11 @@ __cold static int io_rsrc_data_alloc(struct io_ring_ctx *ctx, data = kzalloc(sizeof(*data), GFP_KERNEL); if (!data) - return -ENOMEM; + return ret; data->tags = (u64 **)io_alloc_page_table(nr * sizeof(data->tags[0][0])); if (!data->tags) { kfree(data); - return -ENOMEM; + return ret; } data->nr = nr;