drivers/mmc/host/dw_mmc.c: fix error return code
Subsystems (6)
PATCH 1/4 drivers/mmc/host/dw_mmc.c: fix error return code
From: Peter Senna Tschudin <[email protected]>
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
--- drivers/mmc/host/dw_mmc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/dw_mmc.c +3 -1
@@ -2039,8 +2039,10 @@ int dw_mci_probe(struct dw_mci *host)tasklet_init (&host->tasklet, dw_mci_tasklet_func, (unsigned long )host); host->card_workqueue =alloc_workqueue ("dw-mci-card" ,WQ_MEM_RECLAIM |WQ_NON_REENTRANT ,1 ); -if (!host->card_workqueue) +if (!host->card_workqueue) { + err = -ENOMEM ; goto err_dmaunmap; + }INIT_WORK (&host->card_work, dw_mci_work_routine_card); ret =request_irq (host->irq, dw_mci_interrupt, host->irq_flags,"dw-mci" , host);if (ret)
Signature · 1 line
1.7.11.4
PATCH 2/4 drivers/mmc/host/omap.c: fix error return code
From: Peter Senna Tschudin <[email protected]>
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
--- drivers/mmc/host/omap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/mmc/host/omap.c +6 -2
@@ -1369,8 +1369,10 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev) host->irq = irq; host->phys_base = host->mem_res->start; host->virt_base =ioremap (res->start,resource_size (res)); -if (!host->virt_base) +if (!host->virt_base) { + ret = -ENOMEM ; goto err_ioremap; + } host->iclk =clk_get (&pdev->dev,"ick" );if (IS_ERR (host->iclk)) {
@@ -1438,8 +1440,10 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev) host->reg_shift = (cpu_is_omap7xx () ?1 :2 ); host->mmc_omap_wq =alloc_workqueue ("mmc_omap" ,0 ,0 ); -if (!host->mmc_omap_wq) +if (!host->mmc_omap_wq) { + err = -ENOMEM ; goto err_plat_cleanup; + }for (i =0 ; i < pdata->nr_slots; i++) { ret =mmc_omap_new_slot (host, i);
Signature · 1 line
1.7.11.4
PATCH 3/4 drivers/mmc/host/omap_hsmmc.c: fix error return code
In reply to Peter Senna TschudinFrom: Peter Senna Tschudin <[email protected]>
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
--- drivers/mmc/host/omap_hsmmc.c | 1 + 1 file changed, 1 insertion(+)
drivers/mmc/host/omap_hsmmc.c +1 -0
@@ -1893,6 +1893,7 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)if (pdata->init (&pdev->dev) !=0 ) {dev_dbg (mmc_dev (host->mmc),"Unable to configure MMC IRQs\n" ); + ret = -ENXIO ; goto err_irq_cd_init; } }
Signature · 1 line
1.7.11.4
PATCH 4/4 drivers/mmc/host/mxs-mmc.c: fix error return code
In reply to Peter Senna TschudinFrom: Peter Senna Tschudin <[email protected]>
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
--- drivers/mmc/host/mxs-mmc.c | 1 + 1 file changed, 1 insertion(+)
drivers/mmc/host/mxs-mmc.c +1 -0
@@ -674,6 +674,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)if (!ssp->dmach) {dev_err (mmc_dev (host->mmc),"%s: failed to request dma\n" , __func__); + ret = -ENODEV ; goto out_clk_put; }
Signature · 1 line
1.7.11.4
Quoted 25 lines · Peter Senna Tschudin
From: Peter Senna Tschudin <[email protected]>
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1when != &ret*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
Quoted 1 line
Signed-off-by Peter Senna Tschudin <[email protected]>
Quoted 35 lines · Peter Senna Tschudin
From: Peter Senna Tschudin <[email protected]>
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1when != &ret*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>Signed-off-by Peter Senna Tschudin <[email protected]>--- drivers/mmc/host/dw_mmc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/mmc/host/dw_mmc.c +0
-0
drivers/mmc/host/dw_mmc.c int dw_mci_probe(struct dw_mci *host) · line 2043
Quoted 6 lines
drivers/mmc/host/dw_mmc.c +2
-1@@ -2039,8 +2039,10 @@ int dw_mci_probe(struct dw_mci *host)tasklet_init (&host->tasklet, dw_mci_tasklet_func, (unsigned long )host); host->card_workqueue =alloc_workqueue ("dw-mci-card" ,WQ_MEM_RECLAIM |WQ_NON_REENTRANT ,1 ); -if (!host->card_workqueue) +if (!host->card_workqueue) { + err = -ENOMEM ;
ret is expected instead of err.
err isn't defined.
Thanks,
Seungwon Jeon
Quoted 7 lines
drivers/mmc/host/dw_mmc.c +1
-1goto err_dmaunmap; + }INIT_WORK (&host->card_work, dw_mci_work_routine_card); ret =request_irq (host->irq, dw_mci_interrupt, host->irq_flags,"dw-mci" , host);if (ret) --1.7.11.4
Re: [PATCH 4/4] drivers/mmc/host/mxs-mmc.c: fix error return code
In reply to Peter Senna TschudinDear Peter Senna Tschudin,
Quoted 1 line
From: Peter Senna Tschudin <[email protected]>
The patch description is a bit crap, but otherwise
Quoted 33 lines
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }ret@p1 = 0
)
... when != ret = e1when != &ret*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>Signed-off-by Peter Senna Tschudin <[email protected]>--- drivers/mmc/host/mxs-mmc.c | 1 + 1 file changed, 1 insertion(+)drivers/mmc/host/mxs-mmc.c +0
-0
drivers/mmc/host/mxs-mmc.c static int mxs_mmc_probe(struct platform_device *pdev) · line 679
Quoted 6 lines
drivers/mmc/host/mxs-mmc.c +1
-0@@ -674,6 +674,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)if (!ssp->dmach) {dev_err (mmc_dev (host->mmc),"%s: failed to request dma\n" , __func__); + ret = -ENODEV ; goto out_clk_put; }
Best regards,
Marek Vasut
Quoted 31 lines · Seungwon Jeon
Quoted 30 lines · Peter Senna Tschudin
From: Peter Senna Tschudin <[email protected]>
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1when != &ret*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>Signed-off-by Peter Senna Tschudin <[email protected]>--- drivers/mmc/host/dw_mmc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 13 lines
drivers/mmc/host/dw_mmc.c int dw_mci_probe(struct dw_mci *host) · line 2043
Quoted 11 lines
drivers/mmc/host/dw_mmc.c +2
-1@@ -2039,8 +2039,10 @@ int dw_mci_probe(struct dw_mci *host)tasklet_init (&host->tasklet, dw_mci_tasklet_func, (unsigned long )host); host->card_workqueue =alloc_workqueue ("dw-mci-card" ,WQ_MEM_RECLAIM |WQ_NON_REENTRANT ,1 ); -if (!host->card_workqueue) +if (!host->card_workqueue) { + err = -ENOMEM ;ret is expected instead of err.
err isn't defined.
I'm sorry. Somehow I did not compile for testing this one before sending. I'll fix, test and resend.
Quoted 16 lines
Thanks,
Seungwon JeonQuoted 7 lines
drivers/mmc/host/dw_mmc.c +1
-1goto err_dmaunmap; + }INIT_WORK (&host->card_work, dw_mci_work_routine_card); ret =request_irq (host->irq, dw_mci_interrupt, host->irq_flags,"dw-mci" , host);if (ret) --1.7.11.4
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Peter
PATCH v2 1/4 drivers/mmc/host/dw_mmc.c: fix error return code
In reply to Peter Senna TschudinFrom: Peter Senna Tschudin <[email protected]>
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
--- drivers/mmc/host/dw_mmc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/dw_mmc.c +3 -1
@@ -2039,8 +2039,10 @@ int dw_mci_probe(struct dw_mci *host)tasklet_init (&host->tasklet, dw_mci_tasklet_func, (unsigned long )host); host->card_workqueue =alloc_workqueue ("dw-mci-card" ,WQ_MEM_RECLAIM |WQ_NON_REENTRANT ,1 ); -if (!host->card_workqueue) +if (!host->card_workqueue) { + ret = -ENOMEM ; goto err_dmaunmap; + }INIT_WORK (&host->card_work, dw_mci_work_routine_card); ret =request_irq (host->irq, dw_mci_interrupt, host->irq_flags,"dw-mci" , host);if (ret)
Signature · 1 line
1.7.11.4
Re: [PATCH 3/4] drivers/mmc/host/omap_hsmmc.c: fix error return code
In reply to Peter Senna TschudinQuoted 25 lines · Peter Senna Tschudin
From: Peter Senna Tschudin <[email protected]>
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1when != &ret*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
Quoted 1 line
Signed-off-by Peter Senna Tschudin <[email protected]>
Looks good.
Quoted 25 lines · Peter Senna Tschudin
From: Peter Senna Tschudin <[email protected]>
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1when != &ret*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
Quoted 1 line
Signed-off-by Peter Senna Tschudin <[email protected]>
Looks good.
Quoted 2 lines
--
1.7.11.4
Re: [PATCH 4/4] drivers/mmc/host/mxs-mmc.c: fix error return code
In reply to Peter Senna TschudinQuoted 25 lines · Peter Senna Tschudin
From: Peter Senna Tschudin <[email protected]>
Convert a nonnegative error return code to a negative one, as returned elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1when != &ret*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
Quoted 1 line
Signed-off-by Peter Senna Tschudin <[email protected]>
Quoted 19 lines
--- drivers/mmc/host/mxs-mmc.c | 1 + 1 file changed, 1 insertion(+)drivers/mmc/host/mxs-mmc.c +1
-0@@ -674,6 +674,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)if (!ssp->dmach) {dev_err (mmc_dev (host->mmc),"%s: failed to request dma\n" , __func__); + ret = -ENODEV ; goto out_clk_put; }Signature · 1 line
1.7.11.4