From patchwork Fri Jan 27 21:01:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 9542673 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B5F8C604A0 for ; Fri, 27 Jan 2017 21:21:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A844B281C3 for ; Fri, 27 Jan 2017 21:21:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CD2728306; Fri, 27 Jan 2017 21:21:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3213A281C3 for ; Fri, 27 Jan 2017 21:21:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751793AbdA0VSh (ORCPT ); Fri, 27 Jan 2017 16:18:37 -0500 Received: from mga05.intel.com ([192.55.52.43]:63911 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751536AbdA0VPi (ORCPT ); Fri, 27 Jan 2017 16:15:38 -0500 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP; 27 Jan 2017 13:02:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,297,1477983600"; d="scan'208";a="927457278" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga003.jf.intel.com with ESMTP; 27 Jan 2017 13:02:33 -0800 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1cXDhV-000VgO-Fm; Sat, 28 Jan 2017 05:04:53 +0800 Date: Sat, 28 Jan 2017 05:01:51 +0800 From: kbuild test robot To: Marcelo Tosatti Cc: kbuild-all@01.org, kvm@vger.kernel.org, Robert Hu , Paolo Bonzini Subject: [PATCH] PTP: fix ptr_ret.cocci warnings Message-ID: <20170127210143.GA137465@lkp-ib04.lkp.intel.com> References: <201701280531.vx65xVnW%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201701280531.vx65xVnW%fengguang.wu@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Fengguang Wu --- ptp_kvm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- 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);