Skip to content

Commit

Permalink
usb: gadget: fix ptr_ret.cocci warnings
Browse files Browse the repository at this point in the history
drivers/usb/gadget/udc/r8a66597-udc.c:1849: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

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Fengguang Wu authored and Felipe Balbi committed Nov 3, 2014
1 parent 8b920f1 commit a2655e4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/usb/gadget/udc/r8a66597-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,10 +1845,7 @@ static int r8a66597_sudmac_ioremap(struct r8a66597 *r8a66597,

res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sudmac");
r8a66597->sudmac_reg = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(r8a66597->sudmac_reg))
return PTR_ERR(r8a66597->sudmac_reg);

return 0;
return PTR_ERR_OR_ZERO(r8a66597->sudmac_reg);
}

static int r8a66597_probe(struct platform_device *pdev)
Expand Down

0 comments on commit a2655e4

Please sign in to comment.