[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20190525081826.GA9002@hari-Inspiron-1545>
Date: Sat, 25 May 2019 13:48:26 +0530
From: Hariprasad Kelam <hariprasad.kelam@...il.com>
To: Hariprasad Kelam <hariprasad.kelam@...il.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] drivers/dca: fix warning PTR_ERR_OR_ZERO can be used
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@...il.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
Powered by blists - more mailing lists