[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-2397134ce2d73dcf1d4846579f594c9f3880b2ec@git.kernel.org>
Date: Tue, 24 Jul 2018 08:00:55 -0700
From: tip-bot for YueHaibing <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: hpa@...or.com, yuehaibing@...wei.com, peterz@...radead.org,
torvalds@...ux-foundation.org, mingo@...nel.org,
linux-kernel@...r.kernel.org, tglx@...utronix.de
Subject: [tip:x86/cleanups] x86/platform/pcspeaker: Use PTR_ERR_OR_ZERO() to
fix ptr_ret.cocci warning
Commit-ID: 2397134ce2d73dcf1d4846579f594c9f3880b2ec
Gitweb: https://git.kernel.org/tip/2397134ce2d73dcf1d4846579f594c9f3880b2ec
Author: YueHaibing <yuehaibing@...wei.com>
AuthorDate: Fri, 20 Jul 2018 15:32:13 +0800
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 24 Jul 2018 09:46:42 +0200
x86/platform/pcspeaker: Use PTR_ERR_OR_ZERO() to fix ptr_ret.cocci warning
The ptr_ret.cocci script generates the following warning:
arch/x86/kernel/pcspeaker.c:12:8-14: WARNING: PTR_ERR_OR_ZERO can be used
Use PTR_ERR_OR_ZERO() rather than an open-coded version to fix this.
Signed-off-by: YueHaibing <yuehaibing@...wei.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: gregkh@...uxfoundation.org
Cc: kstewart@...uxfoundation.org
Cc: pombredanne@...b.com
Link: http://lkml.kernel.org/r/20180720073213.14996-1-yuehaibing@huawei.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/kernel/pcspeaker.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/pcspeaker.c b/arch/x86/kernel/pcspeaker.c
index da5190a1ea16..4a710ffffd9a 100644
--- a/arch/x86/kernel/pcspeaker.c
+++ b/arch/x86/kernel/pcspeaker.c
@@ -9,6 +9,6 @@ static __init int add_pcspkr(void)
pd = platform_device_register_simple("pcspkr", -1, NULL, 0);
- return IS_ERR(pd) ? PTR_ERR(pd) : 0;
+ return PTR_ERR_OR_ZERO(pd);
}
device_initcall(add_pcspkr);
Powered by blists - more mailing lists