mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] dca: Use PTR_ERR_OR_ZERO() in dca_sysfs_add_req()
@ 2019-09-06 16:18 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2019-09-06 16:18 UTC (permalink / raw)
  To: kernel-janitors, Allison Randal, Kate Stewart, Michael Ellerman,
	Richard Fontana, Thomas Gleixner
  Cc: LKML, zhong jiang

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 6 Sep 2019 18:05:21 +0200

Simplify this function implementation by using a known function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/dca/dca-sysfs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/dca/dca-sysfs.c b/drivers/dca/dca-sysfs.c
index eb25627b059d..21ebd0af268b 100644
--- a/drivers/dca/dca-sysfs.c
+++ b/drivers/dca/dca-sysfs.c
@@ -24,9 +24,7 @@ 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.23.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-06 16:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 16:18 [PATCH] dca: Use PTR_ERR_OR_ZERO() in dca_sysfs_add_req() Markus Elfring

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

all inboxes | Powered by JetHome®