From patchwork Sun Apr 23 12:25:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Xu X-Patchwork-Id: 676471 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 7124BC77B73 for ; Sun, 23 Apr 2023 12:27:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229580AbjDWM1O (ORCPT ); Sun, 23 Apr 2023 08:27:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjDWM1N (ORCPT ); Sun, 23 Apr 2023 08:27:13 -0400 Received: from hust.edu.cn (mail.hust.edu.cn [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BC55107; Sun, 23 Apr 2023 05:27:12 -0700 (PDT) Received: from dd-virtual-machine.localdomain ([60.247.94.10]) (user=U202112064@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 33NCPgrJ015487-33NCPgrK015487 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sun, 23 Apr 2023 20:25:49 +0800 From: Jing Xu To: Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani , "James E.J. Bottomley" , "Martin K. Petersen" Cc: hust-os-kernel-patches@googlegroups.com, Jing Xu , Dongliang Mu , MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers: mpt3sas: mpt3sas_debugfs: return value check of `mpt3sas_debugfs_root` Date: Sun, 23 Apr 2023 20:25:35 +0800 Message-Id: <20230423122535.31019-1-U202112064@hust.edu.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-FEAS-AUTH-USER: U202112064@hust.edu.cn Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Smatch complains that: mpt3sas_init_debugfs() warn: 'mpt3sas_debugfs_root' is an error pointer or valid There is no need to check the return value of the debugfs_create_dir() function, just delete the dead code. Fixes: 2b01b293f359 ("scsi: mpt3sas: Capture IOC data for debugging purposes") Signed-off-by: Jing Xu Reviewed-by: Dongliang Mu --- drivers/scsi/mpt3sas/mpt3sas_debugfs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_debugfs.c b/drivers/scsi/mpt3sas/mpt3sas_debugfs.c index a6ab1db81167..c92e08c130b9 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_debugfs.c +++ b/drivers/scsi/mpt3sas/mpt3sas_debugfs.c @@ -99,8 +99,6 @@ static const struct file_operations mpt3sas_debugfs_iocdump_fops = { void mpt3sas_init_debugfs(void) { mpt3sas_debugfs_root = debugfs_create_dir("mpt3sas", NULL); - if (!mpt3sas_debugfs_root) - pr_info("mpt3sas: Cannot create debugfs root\n"); } /*