summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkbuild test robot <fengguang.wu@intel.com>2017-01-28 05:01:51 +0800
committerRadim Krčmář <rkrcmar@redhat.com>2017-03-20 16:25:06 +0100
commit49e190ec332e96ba28f24b86f7a92f614707819b (patch)
tree960fe9d4f6facc305b51fa9af85144823798a800
parent3863dff0c3dd72984395c93b12383b393c5c3989 (diff)
downloadlinux-49e190ec332e96ba28f24b86f7a92f614707819b.tar.bz2
PTP: fix ptr_ret.cocci warnings
drivers/ptp/ptp_kvm.c:229:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci CC: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
-rw-r--r--drivers/ptp/ptp_kvm.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/ptp/ptp_kvm.c b/drivers/ptp/ptp_kvm.c
index 09b4df74291e..bb865695d7a6 100644
--- a/drivers/ptp/ptp_kvm.c
+++ b/drivers/ptp/ptp_kvm.c
@@ -193,10 +193,7 @@ static int __init ptp_kvm_init(void)
kvm_ptp_clock.ptp_clock = ptp_clock_register(&kvm_ptp_clock.caps, NULL);
- if (IS_ERR(kvm_ptp_clock.ptp_clock))
- return PTR_ERR(kvm_ptp_clock.ptp_clock);
-
- return 0;
+ return PTR_ERR_OR_ZERO(kvm_ptp_clock.ptp_clock);
}
module_init(ptp_kvm_init);