2019-03-28 09:24:57

by Ding Xiang

[permalink] [raw]
Subject: [PATCH] drivers/fmc: remove unneeded NULL check

The variable will check in debugfs_remove_recursive, so
the NULL check here is not needed

Signed-off-by: Ding Xiang <[email protected]>
---
drivers/fmc/fmc-debug.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/fmc/fmc-debug.c b/drivers/fmc/fmc-debug.c
index 3293072..ab868a3 100644
--- a/drivers/fmc/fmc-debug.c
+++ b/drivers/fmc/fmc-debug.c
@@ -168,6 +168,5 @@ int fmc_debug_init(struct fmc_device *fmc)

void fmc_debug_exit(struct fmc_device *fmc)
{
- if (fmc->dbg_dir)
- debugfs_remove_recursive(fmc->dbg_dir);
+ debugfs_remove_recursive(fmc->dbg_dir);
}
--
1.9.1





2019-03-28 10:23:51

by Mukesh Ojha

[permalink] [raw]
Subject: Re: [PATCH] drivers/fmc: remove unneeded NULL check


On 3/28/2019 2:53 PM, Ding Xiang wrote:
> The variable will check in debugfs_remove_recursive, so
> the NULL check here is not needed
>
> Signed-off-by: Ding Xiang <[email protected]>


Reviewed-by: Mukesh Ojha <[email protected]>

-Mukesh

> ---
> drivers/fmc/fmc-debug.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/fmc/fmc-debug.c b/drivers/fmc/fmc-debug.c
> index 3293072..ab868a3 100644
> --- a/drivers/fmc/fmc-debug.c
> +++ b/drivers/fmc/fmc-debug.c
> @@ -168,6 +168,5 @@ int fmc_debug_init(struct fmc_device *fmc)
>
> void fmc_debug_exit(struct fmc_device *fmc)
> {
> - if (fmc->dbg_dir)
> - debugfs_remove_recursive(fmc->dbg_dir);
> + debugfs_remove_recursive(fmc->dbg_dir);
> }