From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751959AbdJYBLw (ORCPT ); Tue, 24 Oct 2017 21:11:52 -0400 Received: from mailgw01.mediatek.com ([218.249.47.110]:54556 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751758AbdJYBLs (ORCPT ); Tue, 24 Oct 2017 21:11:48 -0400 X-UUID: aaaa24ef1d854af3a5ce06a813247ba7-20171025 Message-ID: <1508893899.17567.123.camel@mhfsdcap03> Subject: Re: [PATCH] usb: xhci-mtk: fix ptr_ret.cocci warnings From: Chunfeng Yun To: kbuild test robot CC: , , Greg Kroah-Hartman , Matthias Brugger , Mathias Nyman , , , Date: Wed, 25 Oct 2017 09:11:39 +0800 In-Reply-To: <20171024163318.GA20883@lkp-wsm-ep2> References: <201710250012.ie44N5j6%fengguang.wu@intel.com> <20171024163318.GA20883@lkp-wsm-ep2> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-10-25 at 00:33 +0800, kbuild test robot wrote: > 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 > --- > Thanks 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)