[PATCH] drivers/fmc: Remove unnecessary NULL check before debugfs_remove_recursive

From: Wen Yang
Date: Wed Dec 05 2018 - 20:19:31 EST


debugfs_remove_recursive() accepts a NULL parameter and returns
immediately, there's no need for a NULL check in the caller.

This issue was detected with the help of Coccinelle.

Signed-off-by: Wen Yang <wen.yang99@xxxxxxxxxx>
CC: Alessandro Rubini <rubini@xxxxxxxxx>
CC: linux-kernel@xxxxxxxxxxxxxxx
---
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 32930722770c..ab868a35e221 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);
}
--
2.19.1