From patchwork Fri Oct 27 01:55:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li zeming X-Patchwork-Id: 158726 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp297390vqb; Thu, 26 Oct 2023 18:56:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5b0GOy4VsNcRs+a5U/Avup52jXPSolJTE44yoseMXmmfY6qTnuf71yGrCFhXJhdnz1ZFZ X-Received: by 2002:a25:e702:0:b0:d43:a84f:a6aa with SMTP id e2-20020a25e702000000b00d43a84fa6aamr1223635ybh.39.1698371774769; Thu, 26 Oct 2023 18:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698371774; cv=none; d=google.com; s=arc-20160816; b=Smn1/Luun6OSNT/f4t1Rj6ng5sV40yJ+zLCvBHgfme9Pqrxcno2uH3RSVQRU4vSLCV 2Sc+eSQP8t4z0Ek8J8c1lk7FDecEgmAmTcrSnavJRkFUGPfKTDrtUnufSvctllUFN62A /O/zKtBzD33M2w8Xah0cRfFgF2AoVjc0W0XTuZmrcFEi8JCrRRxeKGRb8tb6ja511su7 KQyIeX+bmfolKBhH8srVd4nYUkvCST1Ophkmb9poDq+I4r8O43iBTyRK24rfKKubiHnl 6s3xhOqmjw/0OtOJFJcZa/SAv0K0NKdAWv/jYQ8188zSaFnYRoJf6Nv+/yisI0YepJvV jaqA== 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=WYtj8k0ryLlk5TFooq6LCbO8fI4rygSesz/gEwJswOc=; fh=ZTe4kSob55YgbXOvndR9/Y+d0nx291MdJGiuAvIrfpk=; b=zRxt5x9ma8Yla6Zw5/WYroLcw3T+fwdG5XJg1B2AJt6B9m7UR1yALVf+oEBPAtv5Fd mxMfUXRBGVjgGerPFbaaOHmbagvZNVv2SyHFEvoTrHErve72w6e0KlJCjNx9u7VpAmbx px3wIj/AH+hPQbTQ5OJVYn/Jfjzpehj0477goTga/MxNoVz1MXdtXE5NYh8s8eU/0q6O wwhzxPrfldhuBAgDzbiZGG0rs+EZMahmPN3aPvhXFyLD3ytMHfB4fUyJORFNH3PATcWi De4ix7ldLLLFtvfIaaxmJWVwROGTET75ccWkjJTYQ20OdaqiB5SC7yxi82MFVVI+9xvh /0Mw== 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:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id ck13-20020a05690218cd00b00da0bd21bbc4si1547413ybb.722.2023.10.26.18.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 18:56:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 58A2B812522E; Thu, 26 Oct 2023 18:56:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345102AbjJ0B4B (ORCPT + 26 others); Thu, 26 Oct 2023 21:56:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjJ0Bz7 (ORCPT ); Thu, 26 Oct 2023 21:55:59 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id F0F18AB; Thu, 26 Oct 2023 18:55:56 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 6CCE26027ECD5; Fri, 27 Oct 2023 09:55:40 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming To: rafael@kernel.org, pavel@ucw.cz, len.brown@intel.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] power: swap: Assign a value when removing the 'error' definition Date: Fri, 27 Oct 2023 09:55:33 +0800 Message-Id: <20231027015533.25391-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 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 pete.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 (pete.vger.email [0.0.0.0]); Thu, 26 Oct 2023 18:56:12 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780871882048308317 X-GMAIL-MSGID: 1780871882048308317 'error' first receives the function result before it is used, and it does not need to be assigned a value during definition. Signed-off-by: Li zeming --- kernel/power/swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 74edbce2320ba..90bb583c57bf7 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -450,7 +450,7 @@ static int get_swap_writer(struct swap_map_handle *handle) static int swap_write_page(struct swap_map_handle *handle, void *buf, struct hib_bio_batch *hb) { - int error = 0; + int error; sector_t offset; if (!handle->cur)