Message ID | 20170127210143.GA137465@lkp-ib04.lkp.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
--- a/drivers/ptp/ptp_kvm.c +++ b/drivers/ptp/ptp_kvm.c @@ -226,10 +226,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);
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> --- ptp_kvm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)