From patchwork Tue Oct 24 16:33:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 10025083 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 706F96035E for ; Tue, 24 Oct 2017 16:34:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60C6020416 for ; Tue, 24 Oct 2017 16:34:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5526B223B3; Tue, 24 Oct 2017 16:34:36 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 079AD20416 for ; Tue, 24 Oct 2017 16:34:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=t1cHfbqsCHbg1VcW9p/vvvwdSSk+HWhkh27zeYMGPb4=; b=sd7g1dlBA3Zfd+ uQQS+P9CKc+zNWti1RgYU8VR5Ss5Cy89deMaxFkB1gn93j3lYDcS7MlFxZAPZ2XqMZ1q8ELZiNXKC Kkqqn7WUzRiHKIIJW/sfsoL7ucqkLHP+8njvxsfRQCD9izkcdYrJvAOC86d+bBGpaGeuhbb0Js9Eb rgS1RyQ9bVz5kVy7OmGbyrjlvfRa2ANTk4EF6H/tatkmpv3KfppL3Sn83W3UWsizKODNWJ/mDsgjS 8nNuNrWOlfSbnc+FdmvVjOrHHlsHM7NV3EDHJ25fDCwbwE0bUXYiQDF1yp567HDOy34pu7nFeWaMm RwASBbcSI/qNnUZhnsEQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e729y-0006oW-BV; Tue, 24 Oct 2017 16:34:34 +0000 Received: from mga11.intel.com ([192.55.52.93]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e729e-0006Yz-Rn; Tue, 24 Oct 2017 16:34:18 +0000 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2017 09:33:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,428,1503385200"; d="scan'208";a="913242685" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by FMSMGA003.fm.intel.com with ESMTP; 24 Oct 2017 09:33:52 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1e72EF-000NUr-3Z; Wed, 25 Oct 2017 00:38:59 +0800 Date: Wed, 25 Oct 2017 00:33:18 +0800 From: kbuild test robot To: Chunfeng Yun Subject: [PATCH] usb: xhci-mtk: fix ptr_ret.cocci warnings Message-ID: <20171024163318.GA20883@lkp-wsm-ep2> References: <201710250012.ie44N5j6%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201710250012.ie44N5j6%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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171024_093414_920173_31691644 X-CRM114-Status: GOOD ( 10.61 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mathias Nyman , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, kbuild-all@01.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/usb/host/xhci-mtk.c:256: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 Fixes: b6bb72cf0df1 ("usb: xhci-mtk: add optional mcu and dma bus clocks") CC: Chunfeng Yun Signed-off-by: Fengguang Wu Acked-by: Chunfeng Yun --- xhci-mtk.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -253,10 +253,7 @@ static int xhci_mtk_clks_get(struct xhci return PTR_ERR(mtk->mcu_clk); mtk->dma_clk = optional_clk_get(dev, "dma_ck"); - if (IS_ERR(mtk->dma_clk)) - return PTR_ERR(mtk->dma_clk); - - return 0; + return PTR_ERR_OR_ZERO(mtk->dma_clk); } static int xhci_mtk_clks_enable(struct xhci_hcd_mtk *mtk)