Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4244903rdb; Mon, 11 Dec 2023 13:11:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFu293xieizIyMbVpeZoP7ugRZLfrGDf/rF5TVFlNxJl9y+AtO5wVOU+sZ7ohmQT/gJrd7r X-Received: by 2002:a17:903:2642:b0:1d0:6ffd:ae15 with SMTP id je2-20020a170903264200b001d06ffdae15mr2503943plb.124.1702329077251; Mon, 11 Dec 2023 13:11:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702329077; cv=none; d=google.com; s=arc-20160816; b=QLt9ReUq+MWfY6q8NbyCNjMHv3nHz6j4ij/cgFnGvMLr3DE5+a9lBASMeOikTpgRSD 4E6LkgF0JaEE2GKv+QNa5IhiXgw+lFqXSVGVzhOkYkO7SWE7okhztlxqtq6YX5n++5vU cc2Vft/va989eoFFJ7Y/n+LFkERwJ0vLoM2A6BOo7Ezpyvz9Co3ZTysxABxhk3NVQNR/ 7IOD9t6fLUDdXP0WbQNUMzR2lpmAKV0xhlfRu8I4IEOY4VKt3eCDTqIMbigz4MOjBa3x +CCkGCoIzCP4kkqh+iOUjKKxy3l61K0M54P+Bcmg9rh+eFBoGHM9G4P3zTJO/333AmWp 199A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=WBWutgoStTvxig1vePMLIWrvBtP44U7rJXY9gVMMW4E=; fh=carT656xzD2qYeNGxZLwrzBa4GRMR2kSRHuFALzWmUg=; b=T5bQcLoYVxN0dTW/ubfpzjj5ldFu1WhjJcZ0ez7ptXhjsm3fpF68H8OiqgxqbtehMm bFimV1k+PVfoeABjVXrzInnCy7Xt52ZPqvWjxtzGGEmA3AwUfcnb9s8F0eWWgTkk8yzw xnweJ2ChNo2fzInNlsTaCutlG0k1NpbFQup7BfdogIAAl4WkpxVbv7DrVU4j1vyL9xYT YggERY8v7Uk7lrHU9eD0LIZFWY+8FBUQ3g3lrRZcOXoOr/gvSdqFkZQipGZyXxJRBZYm MiHFpZjIW56VjlqNKnnnW1X3L/UkXbuoohVgyCwzSm4PpJKqAwi0GsebyPZgSpQ6JPWC jrkg== 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:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id b6-20020a170902d88600b001d050ef0078si6597744plz.21.2023.12.11.13.11.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 13:11:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5205D809D338; Mon, 11 Dec 2023 13:11:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229790AbjLKVK7 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 11 Dec 2023 16:10:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345051AbjLKVKz (ORCPT ); Mon, 11 Dec 2023 16:10:55 -0500 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF54FCE; Mon, 11 Dec 2023 13:11:01 -0800 (PST) Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-6d9d6f8485eso711709a34.0; Mon, 11 Dec 2023 13:11:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702329061; x=1702933861; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+28nOcEyCcEuwJJom4JSQW5x+/ek8mhjRptDpKqeApE=; b=sqhTYToQpNIxKfyxA2a7yrdheIoCq2ywXrn0fnILnZrcj/pm3iLc1oVjeJrwOJIN7j vWk/nNtwXVsVE/oD42h+/WEYd9PKr9u6t9Z1hPUqcJD93IxBYeViiBCP+ArMV2QzLPSj lNjPovs0OAToFsWpbc2h+TFC8TkcrJq8QJld+v/FmQ+Zidc6P0rjcqJmkcGNj4dM1ip2 /ggbJBitjP21muKk0msXHgiY2k30THtNUQRydoQClHIKh/OptQkw6NIV9IFGiDU/Z5F3 BnNO4xxOdXLBUPO+6z8LVUy0h/18DDCasbHYR6fcwMapRDnIiXHvMgUm++6Q27R0dpjD k5Eg== X-Gm-Message-State: AOJu0YxiBHe3rzoV+HRXqnenwheWtdDFfmJaeJ0Bx1A3cw/n2WKt91om HZEByg0E9HkMAyDd8M/trt81zb67PBjLBSzIcKA= X-Received: by 2002:a05:6871:7589:b0:1fa:db26:78a6 with SMTP id nz9-20020a056871758900b001fadb2678a6mr10132449oac.1.1702329061054; Mon, 11 Dec 2023 13:11:01 -0800 (PST) MIME-Version: 1.0 References: <20231024020434.34145-1-zeming@nfschina.com> In-Reply-To: <20231024020434.34145-1-zeming@nfschina.com> From: "Rafael J. Wysocki" Date: Mon, 11 Dec 2023 22:10:50 +0100 Message-ID: Subject: Re: [PATCH] power: snapshot: Optimize the error variable in the snapshot_write_next() To: Li zeming Cc: rafael@kernel.org, len.brown@intel.com, pavel@ucw.cz, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 11 Dec 2023 13:11:14 -0800 (PST) On Tue, Oct 24, 2023 at 4:05 AM Li zeming wrote: > > 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 */ > -- Applied as 6.8 material with rewritten subject and changelog. Thanks!