ntb.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Sanjay R Mehta <sanmehta@amd.com>
To: Ruan Jinjie <ruanjinjie@huawei.com>,
	ntb@lists.linux.dev, Sanjay R Mehta <sanju.mehta@amd.com>,
	Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
	Jon Mason <jdmason@kudzu.us>, Dave Jiang <dave.jiang@intel.com>,
	Allen Hubbe <allenbh@gmail.com>
Subject: Re: [PATCH -next] ntb: amd: Drop unnecessary error check for debugfs_create_dir
Date: Thu, 17 Aug 2023 12:08:09 +0530	[thread overview]
Message-ID: <b973e79d-916f-5487-e9e0-ef870d009925@amd.com> (raw)
In-Reply-To: <20230817063219.279315-1-ruanjinjie@huawei.com>



On 8/17/2023 12:02 PM, Ruan Jinjie wrote:
> This patch removes the error checking for debugfs_create_dir in
> ntb_hw_amd.c. This is because the DebugFS kernel API is developed
> in a way that the caller can safely ignore the errors that
> occur during the creation of DebugFS nodes. The debugfs APIs have
> a IS_ERR() judge in start_creating() which can handle it
> gracefully. so these checks are unnecessary.
> 

Acked-by: Sanjay R Mehta <sanju.mehta@amd.com>

> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> ---
>  drivers/ntb/hw/amd/ntb_hw_amd.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/ntb/hw/amd/ntb_hw_amd.c b/drivers/ntb/hw/amd/ntb_hw_amd.c
> index 4940b6301d83..d687e8c2cc78 100644
> --- a/drivers/ntb/hw/amd/ntb_hw_amd.c
> +++ b/drivers/ntb/hw/amd/ntb_hw_amd.c
> @@ -941,13 +941,10 @@ static void ndev_init_debugfs(struct amd_ntb_dev *ndev)
>  		ndev->debugfs_dir =
>  			debugfs_create_dir(pci_name(ndev->ntb.pdev),
>  					   debugfs_dir);
> -		if (IS_ERR(ndev->debugfs_dir))
> -			ndev->debugfs_info = NULL;
> -		else
> -			ndev->debugfs_info =
> -				debugfs_create_file("info", S_IRUSR,
> -						    ndev->debugfs_dir, ndev,
> -						    &amd_ntb_debugfs_info);
> +		ndev->debugfs_info =
> +			debugfs_create_file("info", S_IRUSR,
> +					    ndev->debugfs_dir, ndev,
> +					    &amd_ntb_debugfs_info);
>  	}
>  }
>  

      reply	other threads:[~2023-08-17  6:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17  6:32 [PATCH -next] ntb: amd: Drop unnecessary error check for debugfs_create_dir Ruan Jinjie
2023-08-17  6:38 ` Sanjay R Mehta [this message]

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=b973e79d-916f-5487-e9e0-ef870d009925@amd.com \
    --to=sanmehta@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=allenbh@gmail.com \
    --cc=dave.jiang@intel.com \
    --cc=jdmason@kudzu.us \
    --cc=ntb@lists.linux.dev \
    --cc=ruanjinjie@huawei.com \
    --cc=sanju.mehta@amd.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).