[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200507111224.4176-1-tangbin@cmss.chinamobile.com>
Date: Thu, 7 May 2020 19:12:24 +0800
From: Tang Bin <tangbin@...s.chinamobile.com>
To: gregkh@...uxfoundation.org, allison@...utok.net,
rfontana@...hat.com, kstewart@...uxfoundation.org,
mpe@...erman.id.au, tglx@...utronix.de
Cc: linux-kernel@...r.kernel.org,
Tang Bin <tangbin@...s.chinamobile.com>,
Zhang Shengju <zhangshengju@...s.chinamobile.com>
Subject: [PATCH] dca: Use PTR_ERR_OR_ZERO() to simplify code
The function PTR_ERR_OR_ZERO() contains the check of
IS_ERR() and the return of PTR_ERR() or zero.
Signed-off-by: Zhang Shengju <zhangshengju@...s.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@...s.chinamobile.com>
---
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 eb25627b0..21ebd0af2 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.20.1.windows.1
Powered by blists - more mailing lists