mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tomas Henzl <thenzl@redhat.com>
To: Jing Xu <U202112064@hust.edu.cn>,
	Sathya Prakash <sathya.prakash@broadcom.com>,
	Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
	Suganath Prabu Subramani  <suganath-prabu.subramani@broadcom.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: hust-os-kernel-patches@googlegroups.com,
	Dongliang Mu <dzm91@hust.edu.cn>,
	MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers: mpt3sas: mpt3sas_debugfs: return value check of `mpt3sas_debugfs_root`
Date: Tue, 2 May 2023 17:53:10 +0200	[thread overview]
Message-ID: <6e69b57c-80ae-8b6e-cb5f-9e05da46ecd6@redhat.com> (raw)
In-Reply-To: <20230423122535.31019-1-U202112064@hust.edu.cn>

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 <U202112064@hust.edu.cn>
> Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
> ---
>  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?
Also there are other similar issues in this file.

Regards,
Tomas


>  }
>  
>  /*


  reply	other threads:[~2023-05-02 15:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-23 12:25 Jing Xu
2023-05-02 15:53 ` Tomas Henzl [this message]
2023-05-02 17:06   ` Dan Carpenter
2023-05-08 13:40     ` Dongliang Mu
2023-05-08 14:38       ` Dan Carpenter
2023-05-23 14:48         ` Tomas Henzl
2023-05-23 14:57           ` Dan Carpenter
2023-05-23 17:56             ` Tomas Henzl
2023-05-24  4:16               ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6e69b57c-80ae-8b6e-cb5f-9e05da46ecd6@redhat.com \
    --to=thenzl@redhat.com \
    --cc=MPT-FusionLinux.pdl@broadcom.com \
    --cc=U202112064@hust.edu.cn \
    --cc=dzm91@hust.edu.cn \
    --cc=hust-os-kernel-patches@googlegroups.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=suganath-prabu.subramani@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®