From nobody Tue Dec 16 16:44:02 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 AF7AEC77B76 for ; Sun, 23 Apr 2023 12:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229571AbjDWM3f (ORCPT ); Sun, 23 Apr 2023 08:29:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjDWM3d (ORCPT ); Sun, 23 Apr 2023 08:29:33 -0400 Received: from hust.edu.cn (unknown [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A76C81733 for ; Sun, 23 Apr 2023 05:29:28 -0700 (PDT) Received: from dd-virtual-machine.localdomain ([60.247.94.10]) (user=u202114568@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 33NCRdFX003348-33NCRdFY003348 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sun, 23 Apr 2023 20:27:53 +0800 From: Yuchen Yang To: Liam Girdwood , Mark Brown , Stephen Boyd Cc: hust-os-kernel-patches@googlegroups.com, Yuchen Yang , Dongliang Mu , Mark Brown , linux-kernel@vger.kernel.org Subject: [PATCH] drivers: regulator: core: remove return value check of `regulator_init` Date: Sun, 23 Apr 2023 20:27:31 +0800 Message-Id: <20230423122732.31135-1-u202114568@hust.edu.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FEAS-AUTH-USER: u202114568@hust.edu.cn Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Smatch complains that: regulator_init() warn: 'debugfs_root' is an error pointer or valid According to the documentation of the debugfs_create_dir() function, there is no need to check the return value of this function. Just delete the dead code. Fixes: 247514344492 ("regulator: Remove ifdefs for debugfs code") Signed-off-by: Yuchen Yang Reviewed-by: Dongliang Mu --- drivers/regulator/core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 4fcd36055b02..b14f281b1a97 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -6109,8 +6109,6 @@ static int __init regulator_init(void) ret =3D class_register(®ulator_class); =20 debugfs_root =3D debugfs_create_dir("regulator", NULL); - if (!debugfs_root) - pr_warn("regulator: Failed to create debugfs directory\n"); =20 #ifdef CONFIG_DEBUG_FS debugfs_create_file("supply_map", 0444, debugfs_root, NULL, --=20 2.25.1