* [PATCH] x86/platform/olpc: Use the PTR_ERR_OR_ZERO to simplify the code
@ 2018-07-31 16:08 zhong jiang
2018-08-02 12:30 ` [tip:x86/platform] x86/platform/olpc: Use PTR_ERR_OR_ZERO() tip-bot for zhong jiang
0 siblings, 1 reply; 2+ messages in thread
From: zhong jiang @ 2018-07-31 16:08 UTC (permalink / raw)
To: tglx, mingo; +Cc: x86, linux-kernel
use PTR_ERR_OR_ZERO is better than the open code
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
arch/x86/platform/olpc/olpc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/x86/platform/olpc/olpc.c b/arch/x86/platform/olpc/olpc.c
index 7c3077e..f0e920f 100644
--- a/arch/x86/platform/olpc/olpc.c
+++ b/arch/x86/platform/olpc/olpc.c
@@ -311,10 +311,8 @@ static int __init add_xo1_platform_devices(void)
return PTR_ERR(pdev);
pdev = platform_device_register_simple("olpc-xo1", -1, NULL, 0);
- if (IS_ERR(pdev))
- return PTR_ERR(pdev);
- return 0;
+ return PTR_ERR_OR_ZERO(pdev);
}
static int olpc_xo1_ec_probe(struct platform_device *pdev)
--
1.7.12.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* [tip:x86/platform] x86/platform/olpc: Use PTR_ERR_OR_ZERO()
2018-07-31 16:08 [PATCH] x86/platform/olpc: Use the PTR_ERR_OR_ZERO to simplify the code zhong jiang
@ 2018-08-02 12:30 ` tip-bot for zhong jiang
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for zhong jiang @ 2018-08-02 12:30 UTC (permalink / raw)
To: linux-tip-commits; +Cc: hpa, zhongjiang, tglx, mingo, linux-kernel
Commit-ID: c7ba9f7cb55926605983187a68624999b93abb94
Gitweb: https://git.kernel.org/tip/c7ba9f7cb55926605983187a68624999b93abb94
Author: zhong jiang <zhongjiang@huawei.com>
AuthorDate: Wed, 1 Aug 2018 00:08:06 +0800
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 2 Aug 2018 14:25:40 +0200
x86/platform/olpc: Use PTR_ERR_OR_ZERO()
Replace the open coded equivalent with PTR_ERR_OR_ZERO().
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/1533053286-34990-1-git-send-email-zhongjiang@huawei.com
---
arch/x86/platform/olpc/olpc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/x86/platform/olpc/olpc.c b/arch/x86/platform/olpc/olpc.c
index 7c3077e58fa0..f0e920fb98ad 100644
--- a/arch/x86/platform/olpc/olpc.c
+++ b/arch/x86/platform/olpc/olpc.c
@@ -311,10 +311,8 @@ static int __init add_xo1_platform_devices(void)
return PTR_ERR(pdev);
pdev = platform_device_register_simple("olpc-xo1", -1, NULL, 0);
- if (IS_ERR(pdev))
- return PTR_ERR(pdev);
- return 0;
+ return PTR_ERR_OR_ZERO(pdev);
}
static int olpc_xo1_ec_probe(struct platform_device *pdev)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-02 12:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-31 16:08 [PATCH] x86/platform/olpc: Use the PTR_ERR_OR_ZERO to simplify the code zhong jiang
2018-08-02 12:30 ` [tip:x86/platform] x86/platform/olpc: Use PTR_ERR_OR_ZERO() tip-bot for zhong jiang
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®