pcmcia: at91_cf: Use PTR_ERR_OR_ZERO()
Subsystems (2)
PATCH 1/1 pcmcia: at91_cf: Use PTR_ERR_OR_ZERO()
Fix ptr_ret.cocci warnings:
drivers/pcmcia/at91_cf.c:239: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 Vasyl Gomonovych <[email protected]>
--- drivers/pcmcia/at91_cf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/pcmcia/at91_cf.c +1 -3
@@ -236,10 +236,8 @@ static int at91_cf_dt_init(struct platform_device *pdev) pdev->dev.platform_data = board; mc =syscon_regmap_lookup_by_compatible ("atmel,at91rm9200-sdramc" ); -if (IS_ERR (mc)) -return PTR_ERR (mc); - return 0; + return PTR_ERR_OR_ZERO(mc); }#else static int at91_cf_dt_init (struct platform_device *pdev)
Signature · 1 line
1.9.1
Quoted 8 lines · Vasyl Gomonovych
Fix
ptr_ret.cocciwarnings:
drivers/pcmcia/at91_cf.c:239:1-3: WARNING:PTR_ERR_OR_ZEROcan be usedUse
PTR_ERR_OR_ZEROrather than if(IS_ERR(...)) +PTR_ERRGenerated by:
scripts/coccinelle/api/ptr_ret.cocciSigned-off-by Vasyl Gomonovych <[email protected]>
okay...
Acked-by Nicolas Ferre <[email protected]>
Quoted 21 lines
--- drivers/pcmcia/at91_cf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/pcmcia/at91_cf.c +1
-3@@ -236,10 +236,8 @@ static int at91_cf_dt_init(struct platform_device *pdev) pdev->dev.platform_data = board; mc =syscon_regmap_lookup_by_compatible ("atmel,at91rm9200-sdramc" ); -if (IS_ERR (mc)) -return PTR_ERR (mc); - return 0; + return PTR_ERR_OR_ZERO(mc); }#else static int at91_cf_dt_init (struct platform_device *pdev)
Signature · 1 line
Nicolas Ferre
Alexandre Belloni
AppliedQuoted 12 lines · Vasyl Gomonovych
Fix
ptr_ret.cocciwarnings:
drivers/pcmcia/at91_cf.c:239:1-3: WARNING:PTR_ERR_OR_ZEROcan be usedUse
PTR_ERR_OR_ZEROrather than if(IS_ERR(...)) +PTR_ERRGenerated by:
scripts/coccinelle/api/ptr_ret.cocciSigned-off-by Vasyl Gomonovych <[email protected]>--- drivers/pcmcia/at91_cf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Applied, thanks.
Signature · 3 lines
Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com