* [PATCH] usb: xhci-mtk: fix ptr_ret.cocci warnings
[not found] <201710250012.ie44N5j6%fengguang.wu@intel.com>
@ 2017-10-24 16:33 ` kbuild test robot
2017-10-25 1:11 ` Chunfeng Yun
0 siblings, 1 reply; 2+ messages in thread
From: kbuild test robot @ 2017-10-24 16:33 UTC (permalink / raw)
To: linux-arm-kernel
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 <chunfeng.yun@mediatek.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
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)
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH] usb: xhci-mtk: fix ptr_ret.cocci warnings
2017-10-24 16:33 ` [PATCH] usb: xhci-mtk: fix ptr_ret.cocci warnings kbuild test robot
@ 2017-10-25 1:11 ` Chunfeng Yun
0 siblings, 0 replies; 2+ messages in thread
From: Chunfeng Yun @ 2017-10-25 1:11 UTC (permalink / raw)
To: linux-arm-kernel
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 <chunfeng.yun@mediatek.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
>
Thanks
Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> 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)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-25 1:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <201710250012.ie44N5j6%fengguang.wu@intel.com>
2017-10-24 16:33 ` [PATCH] usb: xhci-mtk: fix ptr_ret.cocci warnings kbuild test robot
2017-10-25 1:11 ` Chunfeng Yun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox