From nobody Tue Dec 16 11:50:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBE29CDB474 for ; Fri, 20 Oct 2023 08:38:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376496AbjJTIiA (ORCPT ); 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-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 *ko= bj, { int index; enum suspend_stat_step step; - char *last_failed_step =3D NULL; + char *last_failed_step; =20 index =3D suspend_stats.last_failed_step + REC_FAILED_NUM - 1; index %=3D REC_FAILED_NUM; --=20 2.18.2