public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 -next] platform/x86: intel-ips: fix 'passing zero to PTR_ERR()' warning
@ 2018-11-26 13:19 YueHaibing
  2018-11-26 13:37 ` Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: YueHaibing @ 2018-11-26 13:19 UTC (permalink / raw)
  To: dvhart, andy, jkosina
  Cc: linux-kernel, platform-driver-x86, andriy.shevchenko, YueHaibing

Fix a static code checker warning:
drivers/platform/x86/intel_ips.c:1314
 ips_debugfs_init() warn: passing zero to 'PTR_ERR'
drivers/platform/x86/intel_ips.c:1328
 ips_debugfs_init() warn: passing zero to 'PTR_ERR'

If error occurs,debugfs_create_dir/debugfs_create_file
return NULL while debugfs is enabled, which should not
passing to PTR_ERR.

Fixes: aa7ffc01d254 ("x86 platform driver: intelligent power sharing driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2:Fix typo in patch log and title
---
 drivers/platform/x86/intel_ips.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
index 225638a..a5d1a68 100644
--- a/drivers/platform/x86/intel_ips.c
+++ b/drivers/platform/x86/intel_ips.c
@@ -1311,8 +1311,7 @@ static void ips_debugfs_init(struct ips_driver *ips)
 
 	ips->debug_root = debugfs_create_dir("ips", NULL);
 	if (!ips->debug_root) {
-		dev_err(ips->dev, "failed to create debugfs entries: %ld\n",
-			PTR_ERR(ips->debug_root));
+		dev_err(ips->dev, "failed to create debugfs entries\n")
 		return;
 	}
 
@@ -1325,8 +1324,7 @@ static void ips_debugfs_init(struct ips_driver *ips)
 					  ips->debug_root, node,
 					  &ips_debugfs_ops);
 		if (!ent) {
-			dev_err(ips->dev, "failed to create debug file: %ld\n",
-				PTR_ERR(ent));
+			dev_err(ips->dev, "failed to create debug file\n");
 			goto err_cleanup;
 		}
 	}
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-02  5:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-26 13:19 [PATCH v2 -next] platform/x86: intel-ips: fix 'passing zero to PTR_ERR()' warning YueHaibing
2018-11-26 13:37 ` Andy Shevchenko
2018-11-26 22:04 ` kbuild test robot
2018-12-02  5:01 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox