Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1600980rda; Mon, 23 Oct 2023 19:05:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlkx1uNMUgIL/s4x5UTP2TrgwsfBLWpLxvLb/QbuCKPofvz7PVFJtK8MnV0euUKNgKmdLG X-Received: by 2002:a17:903:22d0:b0:1ca:e16f:a713 with SMTP id y16-20020a17090322d000b001cae16fa713mr8476833plg.2.1698113109928; Mon, 23 Oct 2023 19:05:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698113109; cv=none; d=google.com; s=arc-20160816; b=xensIyspuS0hGcy4S845sbUj+umhMh/D2e+nqzRp3ezWq23s7yOp6BDZEPL60G5+aJ QHjSBRd7dVbVTze8y2E/XOor/G8qPYJUuHQk4thrBCWA8cPxv8H2hLoV46B/L/Y7l1qB rWSoweB3mpsXbgcsw5C9uExryNIBrc/DnPYNuGpBC+u3crWYdc0u2K2nyBlmEA6sf3v0 Th1kwbKUIw0uTwBILWyQw2hvEKzdtEgOKhM0XLwtsxTnQaOiIOSI4Z1NkFecaI/xHBz2 o3HjuJjm77+xrHscAPfuzPUoQsVTvaWY0p+2IBROnqrAb8yhrjtPCzJKc7/t99/9QJRG C2sQ== 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=Xtiwg18dtxl7iEItD1lXUU1XSR2GdzaiGRVL53AUZa4=; fh=XXTE+v89T9KQrmZaeCSUCZJMHSpQ1uTFJCHnUJEkf28=; b=zeg8RsEcIqDV/5rM+L63EzOAX19yPM0ZlD6D0DQe2DPkjqc3MgLZn/fMpBv2riYVys GND93AphXCQ+qYpQsJUvgiWnfYe8S9B92VyTqq6SUqDEtOZFUWj/fKmnUOJHfxjgW/63 chJ6kDjt0Fhvu8WOlZuHeMnYWPY6TA1zFI0aqgKaifQkRPAPY3Z+jwrdccRCGFJMPAlK r3Tr1m1idEPD4qZ03h7L9vkeoEHAPApHAx2cFOY/U/xjkusRwbWuSkqtoSnc90WDCi2c VdV6iCQ28NLbp43c0NiNwHLnPx3V62hAKMTKfOh1xgdEzGHVhXH0E96nt4ZFH16XjNsg VKAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id s128-20020a637786000000b005660335e26fsi7356765pgc.485.2023.10.23.19.05.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 19:05:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 96FF480C5FAA; Mon, 23 Oct 2023 19:05:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232008AbjJXCFG (ORCPT + 99 others); Mon, 23 Oct 2023 22:05:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231916AbjJXCFF (ORCPT ); Mon, 23 Oct 2023 22:05:05 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 43497D7C; Mon, 23 Oct 2023 19:04:59 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id E66DC602A1AC2; Tue, 24 Oct 2023 10:04:41 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming To: rafael@kernel.org, len.brown@intel.com, pavel@ucw.cz Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] power: snapshot: Optimize the error variable in the snapshot_write_next() Date: Tue, 24 Oct 2023 10:04:34 +0800 Message-Id: <20231024020434.34145-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RDNS_NONE,SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 23 Oct 2023 19:05:08 -0700 (PDT) Assign a value when removing the definition for error, which is assigned before use. Signed-off-by: Li zeming --- kernel/power/snapshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 87e9f7e2bdc05..40c141144c9a1 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -2776,7 +2776,7 @@ static void *get_buffer(struct memory_bitmap *bm, struct chain_allocator *ca) int snapshot_write_next(struct snapshot_handle *handle) { static struct chain_allocator ca; - int error = 0; + int error; next: /* Check if we have already loaded the entire image */ -- 2.18.2