From patchwork Fri Oct 27 02:13:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li kunyu X-Patchwork-Id: 158730 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp304586vqb; Thu, 26 Oct 2023 19:13:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMI+J+tGqzhAIML67tSUpo9k/VyNxJF2Z0idowsY2yxbPAOwY+Ew0Np8Utvs1/ErDdQt4f X-Received: by 2002:a81:bc45:0:b0:595:e1b:b978 with SMTP id b5-20020a81bc45000000b005950e1bb978mr1455612ywl.21.1698372808067; Thu, 26 Oct 2023 19:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698372808; cv=none; d=google.com; s=arc-20160816; b=a88f1X97IPljLRumGQvw1xXxLnGpJalyx9zSkBavA3LXrJ9FFohsGoQ5X/o6zYSgnV sA7rC28HmHTlLhL2r91K+W8y4So2jo+t1xgZuMLOo9hkXgfkv1p0uqhE4/yg+5ZPoALM LmjA/Ao7qdRduXtHGkgBi42ZfuCzDJdvoHEa9k0hfs4VpOBFOknQyMhyByahHNawh1Gb FDICY/hkXCGK0xwy0SFt3NKtqChiTSeRq8I9umO9WFDsorefnxbKkzhHTAMG3iwrxrFG MLZhqsSk5lkq+11kq7m4730clFC2CJS2+3sKUx4YxM+Kw8tiwO17x0ULmWaXFQ1620w8 OtSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=jrbqV+PR4x8pZ9/E9sPm+aBd7lKLLdo6cpZuuYFH5sc=; fh=gng3GjAizY8SnQHPS486ZK2NODGov29fVA/FI0kGI1c=; b=a51fblGegdDaCR7fqDIyWGozz5VNNpcWVJ+yfPRRUlw57m2fTuoCcuUtqmuAUKXIBU 1fsVVy+bsPKYaNXVuwoXoLpJWVKHP2vFyBpluXGGathkE565sQ5Am1Bhu/+DSvlir8tK R7fQAOcPxmbug5nGf1zM2RQepgNBr0OYyLF2md3JT80cOv9ugrGOOu4qnpETFLVSwYkH 3r+7McjykiWyERYI7poSZD6XqSTaKABB4CnqP3qZnvrUtGZ6/X6soyxECW506dcxURQC q0ult8YhgVNL1g4sFua3JPHhG6gG4VjxikxuRVfXi3R5eLl8LZSK34MpQhh6g4/5DTwS dQ3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id w188-20020a0dd4c5000000b005928659f386si1049362ywd.89.2023.10.26.19.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 19:13:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8434F83A9F86; Thu, 26 Oct 2023 19:13:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345156AbjJ0CNN (ORCPT + 26 others); Thu, 26 Oct 2023 22:13:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbjJ0CNL (ORCPT ); Thu, 26 Oct 2023 22:13:11 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 4A23C194; Thu, 26 Oct 2023 19:13:08 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 20EFA6027FD55; Fri, 27 Oct 2023 10:13:06 +0800 (CST) X-MD-Sfrom: kunyu@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li kunyu To: rafael@kernel.org, pavel@ucw.cz, len.brown@intel.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Li kunyu Subject: [PATCH] =?utf-8?q?power=3A_swap=3A_Remove_unnecessary_=E2=80=980?= =?utf-8?q?=E2=80=99_values_from_ret?= Date: Fri, 27 Oct 2023 10:13:03 +0800 Message-Id: <20231027021303.26187-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 26 Oct 2023 19:13:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780872965427452633 X-GMAIL-MSGID: 1780872965427452633 'ret 'is first assigned a value and then used, it does not need to be assigned at definition time. Signed-off-by: Li kunyu --- kernel/power/swap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 90bb583c57bf7..32e8cb6ceaea4 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -679,7 +679,7 @@ static int save_image_lzo(struct swap_map_handle *handle, unsigned int nr_to_write) { unsigned int m; - int ret = 0; + int ret; int nr_pages; int err2; struct hib_bio_batch hb; @@ -1060,7 +1060,7 @@ static int load_image(struct swap_map_handle *handle, unsigned int nr_to_read) { unsigned int m; - int ret = 0; + int ret; ktime_t start; ktime_t stop; struct hib_bio_batch hb; @@ -1166,7 +1166,7 @@ static int load_image_lzo(struct swap_map_handle *handle, unsigned int nr_to_read) { unsigned int m; - int ret = 0; + int ret; int eof = 0; struct hib_bio_batch hb; ktime_t start;