x86/platform/pcspeaker: Use PTR_ERR_OR_ZERO() to fix ptr_ret.cocci warning
authorYueHaibing <yuehaibing@huawei.com>
Fri, 20 Jul 2018 07:32:13 +0000 (15:32 +0800)
committerIngo Molnar <mingo@kernel.org>
Tue, 24 Jul 2018 07:46:42 +0000 (09:46 +0200)
commit2397134ce2d73dcf1d4846579f594c9f3880b2ec
tree6081624e177054417a8fa6650208d3af23854d73
parentd72e90f33aa4709ebecc5005562f52335e106a60
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@huawei.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: gregkh@linuxfoundation.org
Cc: kstewart@linuxfoundation.org
Cc: pombredanne@nexb.com
Link: http://lkml.kernel.org/r/20180720073213.14996-1-yuehaibing@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/pcspeaker.c