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: 10025081 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 3D8D16035E for ; Tue, 24 Oct 2017 16:34:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E2E920072 for ; Tue, 24 Oct 2017 16:34:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22A5B204FA; Tue, 24 Oct 2017 16:34:29 +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 E6D2A20072 for ; Tue, 24 Oct 2017 16:34:26 +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=c+rLaKB+PFwkYHuDu1iCurqmlh6tTh5KgPej0ls+yRw=; b=BludOaadsqiFOa jZotxsTvPjSpWGyJOouh4bXrOHNTkY3ee8LZu7Gle5RTd88Dy/wlRnMcIBo4uy8hLMF31DA7nqktt hAYb139z1CuhZGMykV3r9Cl4xQQs21kn5C/RR5mJLBoHYe3ZDGWoLK14aXSswilMXJXKZc1MyzD3F q4RAdscIiyd2yDvWaDHEKMWc7A+N7setRSGYRG8PgvOz3r2JMJIh4UeFPBpkxgrUL7da3AiJlr5ES DJLBlQG1fr8wUUGZTOAx8/7jd1WviA3VOndA86U/5ftM0SZW+3uqJ/RR55Itn1nTSowER54+EGlVn SzpVnHc63qzsesVC8zmw==; 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 1e729j-0006ay-LX; Tue, 24 Oct 2017 16:34:19 +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-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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)