2019-06-20 10:13:51

by Ding Xiang

[permalink] [raw]
Subject: [PATCH] FMC: fix 'passing zero to PTR_ERR()' warning

Fix a static code checker warning:
drivers/fmc/fmc-debug.c:155
fmc_debug_init() warn: passing zero to 'PTR_ERR'

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

diff --git a/drivers/fmc/fmc-debug.c b/drivers/fmc/fmc-debug.c
index 1734c7c..dd33951 100644
--- a/drivers/fmc/fmc-debug.c
+++ b/drivers/fmc/fmc-debug.c
@@ -152,7 +152,7 @@ int fmc_debug_init(struct fmc_device *fmc)
fmc->dbg_dir = debugfs_create_dir(dev_name(&fmc->dev), NULL);
if (IS_ERR_OR_NULL(fmc->dbg_dir)) {
pr_err("FMC: Cannot create debugfs\n");
- return PTR_ERR(fmc->dbg_dir);
+ return PTR_ERR_OR_ZERO(fmc->dbg_dir);
}

fmc->dbg_sdb_dump = debugfs_create_file(FMC_DBG_SDB_DUMP, 0444,
--
1.9.1




2019-06-20 14:29:30

by Alessandro Rubini

[permalink] [raw]
Subject: Re: [PATCH] FMC: fix 'passing zero to PTR_ERR()' warning

Hello.

drivers/fmc is going to be removed from the official kernel (removal
is queued by Linus Walleij, with approval by fmc authors).
So this patch should be dropped.

thanks
/alessandro