Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp871340rdb; Fri, 20 Oct 2023 01:38:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHjAdeeGbxqnzg/pckABVeujQJpuxTSkP8cRGS2l6ltWBW+oK5gHGxiBbKD5wUBiO46wZ/p X-Received: by 2002:a05:6808:23c8:b0:3ac:aae1:6d64 with SMTP id bq8-20020a05680823c800b003acaae16d64mr1447907oib.2.1697791102096; Fri, 20 Oct 2023 01:38:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697791102; cv=none; d=google.com; s=arc-20160816; b=Fsi5GFE8ud1blalzBEcflTlzoBOqPM0GeBhXsJNGv6hQmQjeXPASqR19BG1K38OJoo /afnvT9CQ7uhOQpJVERqN3VY+el7+KpF1WbXzOZvZCAxfg8BoCb4V1xXUihsgSSVyQuj 4n+fclDe1Htw3YjPW081DeeIxH9h1bxhQlyrBUdZ22JpeiTCnDjRMmkEPQ40e3m/CzwJ iwovgHxLUGPdkAfUPJiQweSe3RV+wnR3DGtgsFaGbZ2pYz2X9Qbquv5KCxQeYtFtRnD5 ouOGls06JUVOzTq3VtsthY3/6Eb8V93LHDPJ2K95+gXbswUssfi0HVyNU7O4ZjSjC3SA WzdA== 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=oKmQVOEH+WGWhkE05M48QGhcn8TfhA/HmGwvxRvU78s=; fh=rshCwnZljDS3Iq6xUe9fors7BVvCQ4+e/d1cc+r3q3c=; b=QgucKS+1fhMqN8h9VqqZVt2kBVFuYUmheXR60lbi5xrTTuP+NmIA9+OjrcQn5S3R5A r9ibgyA0AvtjXGPCWNhPpNn1dOI8OsgHAUMeh19mnQO6WRWxdXiKfJtyWf273ybcyuag CnlnBzImLuwPxPK0nlpqOvdV4g/fYwHO4ZZ2v5CeDK8pSk3M20k5/L7glQwvllzUi6s0 IcfodUBESntxNJEY7G7z9Laaq+kvsdRo7Xd29k6w+CcIi/PHAUrt/3zTRxdKG5y1NCYi /yavxUMaTv5qdxt3wlysJxOP4z4efpdcDdXVDW2gNXTFDRsZ+CZBrP4RPJCNymGsoIZI jbhw== 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 Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id b26-20020a63931a000000b005aa56e17658si1392956pge.168.2023.10.20.01.38.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 01:38:22 -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 9898282271B2; Fri, 20 Oct 2023 01:38:18 -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 S1376497AbjJTIiA (ORCPT + 99 others); Fri, 20 Oct 2023 04:38:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376486AbjJTIh6 (ORCPT ); Fri, 20 Oct 2023 04:37:58 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 13F0BD53; Fri, 20 Oct 2023 01:37:55 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 9B143604652C0; Fri, 20 Oct 2023 16:37:50 +0800 (CST) X-MD-Sfrom: zhoujie@nfschina.com X-MD-SrcIP: 219.141.250.2 From: ZhouJie To: rafael@kernel.org, pavel@ucw.cz, len.brown@intel.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, ZhouJie Subject: [PATCH] =?UTF-8?q?power:=20main:=20Remove=20unnecessary=20?= =?UTF-8?q?=E2=80=98NULL=E2=80=99=20initialization=20from=20last=5Ffailed?= =?UTF-8?q?=5Fstep=5Fshow()?= Date: Fri, 20 Oct 2023 16:37:43 +0800 Message-Id: <20231020083743.11412-1-zhoujie@nfschina.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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]); Fri, 20 Oct 2023 01:38:18 -0700 (PDT) Declaring char *last_failed_step; is reasonable because you can later assign the function's return value to last_failed_step without explicitly assigning an initial value. Signed-off-by: ZhouJie --- kernel/power/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/power/main.c b/kernel/power/main.c index f6425ae3e8b05..24c675f6ab862 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -410,7 +410,7 @@ static ssize_t last_failed_step_show(struct kobject *kobj, { int index; enum suspend_stat_step step; - char *last_failed_step = NULL; + char *last_failed_step; index = suspend_stats.last_failed_step + REC_FAILED_NUM - 1; index %= REC_FAILED_NUM; -- 2.18.2