2023-07-26 13:46:44

by Wang Ming

[permalink] [raw]
Subject: [PATCH v2] hsi: controllers: Remove error checking for debugfs_create_dir()

It is expected that most callers should _ignore_ the errors
return by debugfs_create_dir() in bond_debug_reregister().

Signed-off-by: Wang Ming <[email protected]>
---
drivers/hsi/controllers/omap_ssi_core.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/hsi/controllers/omap_ssi_core.c b/drivers/hsi/controllers/omap_ssi_core.c
index 84ba8b875..57c63053f 100644
--- a/drivers/hsi/controllers/omap_ssi_core.c
+++ b/drivers/hsi/controllers/omap_ssi_core.c
@@ -115,8 +115,6 @@ static int ssi_debug_add_ctrl(struct hsi_controller *ssi)

/* SSI controller */
omap_ssi->dir = debugfs_create_dir(dev_name(&ssi->device), NULL);
- if (!omap_ssi->dir)
- return -ENOMEM;

debugfs_create_file("regs", S_IRUGO, omap_ssi->dir, ssi,
&ssi_regs_fops);
--
2.25.1



2023-07-31 21:27:46

by Sebastian Reichel

[permalink] [raw]
Subject: Re: [PATCH v2] hsi: controllers: Remove error checking for debugfs_create_dir()

Hi,

On Wed, Jul 26, 2023 at 08:30:46PM +0800, Wang Ming wrote:
> It is expected that most callers should _ignore_ the errors
> return by debugfs_create_dir() in bond_debug_reregister().

bond_debug_reregister()?

> Signed-off-by: Wang Ming <[email protected]>
> ---
> drivers/hsi/controllers/omap_ssi_core.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/hsi/controllers/omap_ssi_core.c b/drivers/hsi/controllers/omap_ssi_core.c
> index 84ba8b875..57c63053f 100644
> --- a/drivers/hsi/controllers/omap_ssi_core.c
> +++ b/drivers/hsi/controllers/omap_ssi_core.c
> @@ -115,8 +115,6 @@ static int ssi_debug_add_ctrl(struct hsi_controller *ssi)

function can become void, if errors are ignored.

>
> /* SSI controller */
> omap_ssi->dir = debugfs_create_dir(dev_name(&ssi->device), NULL);
> - if (!omap_ssi->dir)
> - return -ENOMEM;

What about the second debugfs_create_dir() call in the same function?

>
> debugfs_create_file("regs", S_IRUGO, omap_ssi->dir, ssi,
> &ssi_regs_fops);

-- Sebastian


Attachments:
(No filename) (1.04 kB)
signature.asc (849.00 B)
Download all attachments