* [PATCH] drivers/dca: fix warning PTR_ERR_OR_ZERO can be used
@ 2019-05-25 8:18 Hariprasad Kelam
0 siblings, 0 replies; only message in thread
From: Hariprasad Kelam @ 2019-05-25 8:18 UTC (permalink / raw)
To: Hariprasad Kelam, linux-kernel
fix below warning reported by coccicheck
./drivers/dca/dca-sysfs.c:43:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
drivers/dca/dca-sysfs.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/dca/dca-sysfs.c b/drivers/dca/dca-sysfs.c
index 126cf29..5270705 100644
--- a/drivers/dca/dca-sysfs.c
+++ b/drivers/dca/dca-sysfs.c
@@ -40,9 +40,8 @@ int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot)
cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1), NULL,
"requester%d", req_count++);
- if (IS_ERR(cd))
- return PTR_ERR(cd);
- return 0;
+
+ return PTR_ERR_OR_ZERO(cd);
}
void dca_sysfs_remove_req(struct dca_provider *dca, int slot)
--
2.7.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-05-25 8:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-25 8:18 [PATCH] drivers/dca: fix warning PTR_ERR_OR_ZERO can be used Hariprasad Kelam
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.