]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM: davinci: Use PTR_ERR_OR_ZERO()
authorVasyl Gomonovych <gomonovych@gmail.com>
Mon, 27 Nov 2017 23:03:33 +0000 (00:03 +0100)
committerSekhar Nori <nsekhar@ti.com>
Sat, 23 Dec 2017 10:16:25 +0000 (15:46 +0530)
Fix ptr_ret.cocci warnings:
arch/arm/mach-davinci/devices-da8xx.c:255:8-14: WARNING: PTR_ERR_OR_ZERO can be used
arch/arm/mach-davinci/devices-da8xx.c:300:8-14: WARNING: PTR_ERR_OR_ZERO can be used
arch/arm/mach-davinci/dm646x.c:952:8-14: 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: Vasyl Gomonovych <gomonovych@gmail.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arch/arm/mach-davinci/devices-da8xx.c
arch/arm/mach-davinci/dm646x.c

index 22440c05d66ace5e6992ed30a3d412eaa1f25eed..e1c40e73d30abca32e53f7cf92650b322a936141 100644 (file)
@@ -252,7 +252,7 @@ int __init da830_register_edma(struct edma_rsv_info *rsv)
        da8xx_edma0_pdata.slavecnt = ARRAY_SIZE(da830_edma_map);
 
        edma_pdev = platform_device_register_full(&da8xx_edma0_device);
-       return IS_ERR(edma_pdev) ? PTR_ERR(edma_pdev) : 0;
+       return PTR_ERR_OR_ZERO(edma_pdev);
 }
 
 static const struct dma_slave_map da850_edma0_map[] = {
@@ -297,7 +297,7 @@ int __init da850_register_edma(struct edma_rsv_info *rsv[2])
        da850_edma1_pdata.slavecnt = ARRAY_SIZE(da850_edma1_map);
 
        edma_pdev = platform_device_register_full(&da850_edma1_device);
-       return IS_ERR(edma_pdev) ? PTR_ERR(edma_pdev) : 0;
+       return PTR_ERR_OR_ZERO(edma_pdev);
 }
 
 static struct resource da8xx_i2c_resources0[] = {
index b72e04ad81ce3e81ac35279bbc3b61b1121571ff..6fc06a6ad4f8683824b5d2e9230654c59f61c419 100644 (file)
@@ -949,7 +949,7 @@ int __init dm646x_init_edma(struct edma_rsv_info *rsv)
        dm646x_edma_pdata.rsv = rsv;
 
        edma_pdev = platform_device_register_full(&dm646x_edma_device);
-       return IS_ERR(edma_pdev) ? PTR_ERR(edma_pdev) : 0;
+       return PTR_ERR_OR_ZERO(edma_pdev);
 }
 
 void __init dm646x_init(void)