Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4391454rwr; Mon, 8 May 2023 07:07:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7gMlKqW58ZJs2U1rzxJKujF8/tOjAMTm8IUVGNci+COR/99w/atvgHlP/pWRiIJ7UYGLF8 X-Received: by 2002:a17:902:c94b:b0:1ab:14f2:e7e6 with SMTP id i11-20020a170902c94b00b001ab14f2e7e6mr12386671pla.65.1683554840919; Mon, 08 May 2023 07:07:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683554840; cv=none; d=google.com; s=arc-20160816; b=WM3UI4eK0hDTm8zETJxgAID9b79pG54p9ncrcCo+V4KOuWqwXe9QZbjFN6KKGkOh06 W2no/2Ocr1NvwTHecOjyv+mKWI/JfOGj6758gYERkgR13vBmFvy2kBGbNan4xgvqGrDO nuVHLcqpFZeUXE6BMLRWbhRrMpMvpbaBETMzuRUc09yeOrWtAF5YtonHCZY+7wogHvQv 2ZY8AHfmEAA8dx1EZ5ea0h11gUeasEhJcmuK7jAhb0onfhlkdoToByvUmWiZGHPNmWRp XbSYzvY9wGrIc+HQtHUzaTsONaikeBaKqvMhsln1/w2DFXhxts3DJ96QnVf4GSXgMLow pxkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=/4uNUnHTFJaDYZd1CeWBPC3tLcAMmTHJx+vYdv4mpUc=; b=T8+XL5CbjBYOqGfvyLbtfjWr++78tI3IStxXzRDHpYUmphG3Sm7ryNTt7dWnKdxYaQ J3BMR+Y0RPgF24O5Wgb8XR7X5v2Od/gWXjiQwXsk86XiDmD1VSzmYDBf4thWOAwWfkG3 M5KVPhbMkgnEGurjIECFpguxgA1o/+Y2YvmjRzM7W/vbo8ohyC2vzkknRDX6ZNdMZ6wQ mmnDAb/rhIRerivdvIZ9BynL3BrlaZV4RlSGzxRCrbfxWxB4vckw2XinIDwT+ejYu/bb D53qvd6/wCES93M5jeUoQ2TWDXby4QcLIl/5a8SSJIhi++lr2DzEgNrZv/EgOI1ZtcYP dZGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d12-20020a63360c000000b004da377c33bbsi8087782pga.85.2023.05.08.07.07.08; Mon, 08 May 2023 07:07:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234237AbjEHNo6 (ORCPT + 99 others); Mon, 8 May 2023 09:44:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232748AbjEHNo4 (ORCPT ); Mon, 8 May 2023 09:44:56 -0400 Received: from hust.edu.cn (unknown [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB95C25276; Mon, 8 May 2023 06:44:54 -0700 (PDT) Received: from [IPV6:2001:250:4000:5122:23cb:1d84:8ee4:cdb3] ([172.16.0.254]) (user=dzm91@hust.edu.cn mech=PLAIN bits=0) by mx1.hust.edu.cn with ESMTP id 348DheMI007261-348DheMJ007261 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Mon, 8 May 2023 21:43:40 +0800 Message-ID: Date: Mon, 8 May 2023 21:40:41 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] drivers: mpt3sas: mpt3sas_debugfs: return value check of `mpt3sas_debugfs_root` Content-Language: en-US To: Dan Carpenter , Tomas Henzl Cc: Jing Xu , Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani , "James E.J. Bottomley" , "Martin K. Petersen" , hust-os-kernel-patches@googlegroups.com, MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230423122535.31019-1-U202112064@hust.edu.cn> <6e69b57c-80ae-8b6e-cb5f-9e05da46ecd6@redhat.com> <1484408f-f68e-4354-ab59-56af9cd1ef14@kili.mountain> From: Dongliang Mu In-Reply-To: <1484408f-f68e-4354-ab59-56af9cd1ef14@kili.mountain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-FEAS-AUTH-USER: dzm91@hust.edu.cn X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/3/23 01:06, Dan Carpenter wrote: > On Tue, May 02, 2023 at 05:53:10PM +0200, Tomas Henzl wrote: >> On 4/23/23 14:25, Jing Xu wrote: >>> 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"); >> Hi Jing, >> most drivers just ignore the return value but here the author wanted to >> have the information logged. >> Can you instead of removing the message modify the 'if' condition so it >> suits the author's intention? > > This code was always just wrong. > > The history of this is slightly complicated and boring. These days it's > harmless dead code so I guess it's less bad than before. Hi Dan and Tomas, Any conclusion about this patch? The student Jing Xu is not sure about how to revise this patch. > > > regards, > dan carpenter