From nobody Wed Dec 17 13:54:40 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 335E3C77B7C for ; Wed, 19 Apr 2023 10:02:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232896AbjDSKCd (ORCPT ); Wed, 19 Apr 2023 06:02:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232838AbjDSKC3 (ORCPT ); Wed, 19 Apr 2023 06:02:29 -0400 Received: from hust.edu.cn (unknown [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AB647DBA for ; Wed, 19 Apr 2023 03:02:27 -0700 (PDT) Received: from archlinux.localdomain ([10.12.190.56]) (user=zkhuang@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 33JA1VTK021595-33JA1VTL021595 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 19 Apr 2023 18:01:36 +0800 From: Zhengkang Huang To: Benson Leung Cc: Zhengkang Huang , Dongliang Mu , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] platform: chrome: wilco_ec: remove return value check of debugfs_create_dir() Date: Wed, 19 Apr 2023 18:03:03 +0800 Message-Id: <20230419100303.343379-1-zkhuang@hust.edu.cn> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FEAS-AUTH-USER: zkhuang@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: wilco_ec_debugfs_probe() warn: 'debug_info->dir' is an error=20 pointer or valid=20 Debugfs checks are generally not supposed to be checked=20 for errors and it is not necessary here.=20 Just delete the dead code.=20 Signed-off-by: Zhengkang Huang Reviewed-by: Dongliang Mu --- NOTES: The issue is found by static analysis and remains untested. --- drivers/platform/chrome/wilco_ec/debugfs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/platform/chrome/wilco_ec/debugfs.c b/drivers/platform/= chrome/wilco_ec/debugfs.c index a812788a0bdc..7a13f13b16cd 100644 --- a/drivers/platform/chrome/wilco_ec/debugfs.c +++ b/drivers/platform/chrome/wilco_ec/debugfs.c @@ -251,8 +251,6 @@ static int wilco_ec_debugfs_probe(struct platform_devic= e *pdev) return 0; debug_info->ec =3D ec; debug_info->dir =3D debugfs_create_dir("wilco_ec", NULL); - if (!debug_info->dir) - return 0; debugfs_create_file("raw", 0644, debug_info->dir, NULL, &fops_raw); debugfs_create_file("h1_gpio", 0444, debug_info->dir, ec, &fops_h1_gpio); --=20 2.40.0