From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932356AbdJXQef (ORCPT ); Tue, 24 Oct 2017 12:34:35 -0400 Received: from mga02.intel.com ([134.134.136.20]:25447 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751683AbdJXQeX (ORCPT ); Tue, 24 Oct 2017 12:34:23 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,428,1503385200"; d="scan'208";a="913242685" Date: Wed, 25 Oct 2017 00:33:18 +0800 From: kbuild test robot To: Chunfeng Yun Cc: kbuild-all@01.org, linux-usb@vger.kernel.org, Greg Kroah-Hartman , Matthias Brugger , Mathias Nyman , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org 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-Type: text/plain; charset=us-ascii 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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)