drivers/video/mb862xx/mb862xxfbdrv.c: fix error return code
Subsystems (6)
PATCH 1/10 drivers/video/mb862xx/mb862xxfbdrv.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/video/mb862xx/mb862xxfbdrv.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/video/mb862xx/mb862xxfbdrv.c +7 -3
@@ -1052,12 +1052,14 @@ static int __devinit mb862xx_pci_probe(struct pci_dev *pdev,break ;default :/* should never occur */ + ret = -EIO ; goto rel_reg; } par->fb_base =ioremap (par->fb_base_phys, par->mapped_vram);if (par->fb_base =NULL ) {dev_err (dev,"Cannot map framebuffer\n" ); + ret = -EIO ; goto rel_reg; }
@@ -1073,11 +1075,13 @@ static int __devinit mb862xx_pci_probe(struct pci_dev *pdev,dev_dbg (dev,"mmio phys 0x%llx 0x%lx\n" , (unsigned long long )par->mmio_base_phys, (ulong )par->mmio_len); -if (mb862xx_pci_gdc_init (par)) + ret =mb862xx_pci_gdc_init (par); +if (ret) goto io_unmap; -if (request_irq (par->irq, mb862xx_intr,IRQF_SHARED , -DRV_NAME , (void *)par)) { + ret =request_irq (par->irq, mb862xx_intr,IRQF_SHARED , +DRV_NAME , (void *)par); +if (ret) {dev_err (dev,"Cannot request irq\n" ); goto io_unmap; }
Signature · 1 line
1.7.11.4
PATCH 2/10 drivers/video/sunxvr1000.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/video/sunxvr1000.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/video/sunxvr1000.c +3 -1
@@ -141,8 +141,10 @@ static int __devinit gfb_probe(struct platform_device *op) gp->fb_base =of_ioremap (&op->resource[6 ],0 , gp->fb_size,"gfb fb" ); -if (!gp->fb_base) +if (!gp->fb_base) { + err = -ENOMEM ; goto err_release_fb; + } err =gfb_set_fbinfo (gp);if (err)
Signature · 1 line
1.7.11.4
PATCH 3/10 drivers/video/cg3.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/video/cg3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/video/cg3.c +2 -1
@@ -398,7 +398,8 @@ static int __devinit cg3_probe(struct platform_device *op) goto out_unmap_screen; } -if (fb_alloc_cmap (&info->cmap,256 ,0 )) + err =fb_alloc_cmap (&info->cmap,256 ,0 ); +if (err) goto out_unmap_screen;fb_set_cmap (&info->cmap, info);
Signature · 1 line
1.7.11.4
PATCH 4/10 drivers/video/sunxvr500.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/video/sunxvr500.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/video/sunxvr500.c +6 -2
@@ -298,8 +298,10 @@ static int __devinit e3d_pci_register(struct pci_dev *pdev, goto err_release_fb; } ep->ramdac =ioremap (ep->regs_base_phys +0x8000 ,0x1000 ); -if (!ep->ramdac) +if (!ep->ramdac) { + err = -ENOMEM ; goto err_release_pci1; + } ep->fb8_0_off =readl (ep->ramdac +RAMDAC_VID_8FB_0 ); ep->fb8_0_off -= ep->fb_base_reg;
@@ -343,8 +345,10 @@ static int __devinit e3d_pci_register(struct pci_dev *pdev, ep->fb_size = info->fix.line_length * ep->height; ep->fb_base =ioremap (ep->fb_base_phys, ep->fb_size); -if (!ep->fb_base) +if (!ep->fb_base) { + err = -ENOMEM ; goto err_release_pci0; + } err =e3d_set_fbinfo (ep);if (err)
Signature · 1 line
1.7.11.4
PATCH 5/10 drivers/video/atmel_lcdfb.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/video/atmel_lcdfb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/video/atmel_lcdfb.c +4 -1
@@ -931,8 +931,10 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) } info->screen_base =ioremap (info->fix.smem_start, info->fix.smem_len); -if (!info->screen_base) +if (!info->screen_base) { + ret = -ENOMEM ; goto release_intmem; + }/* * Don't clear the framebuffer -- someone may have set
@@ -960,6 +962,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) sinfo->mmio =ioremap (info->fix.mmio_start, info->fix.mmio_len);if (!sinfo->mmio) {dev_err (dev,"cannot map LCDC registers\n" ); + ret = -ENOMEM ; goto release_mem; }
Signature · 1 line
1.7.11.4
PATCH 6/10 drivers/video/imxfb.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/video/imxfb.c | 1 + 1 file changed, 1 insertion(+)
drivers/video/imxfb.c +1 -0
@@ -803,6 +803,7 @@ static int __init imxfb_probe(struct platform_device *pdev) fbi->regs =ioremap (res->start,resource_size (res));if (fbi->regs =NULL ) {dev_err (&pdev->dev,"Cannot map frame buffer registers\n" ); + ret = -ENOMEM ; goto failed_ioremap; }
Signature · 1 line
1.7.11.4
PATCH 7/10 drivers/video/bw2.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/video/bw2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/video/bw2.c +3 -1
@@ -319,8 +319,10 @@ static int __devinit bw2_probe(struct platform_device *op) info->screen_base =of_ioremap (&op->resource[0 ],0 , info->fix.smem_len,"bw2 ram" ); -if (!info->screen_base) +if (!info->screen_base) { + err = -ENOMEM ; goto out_unmap_regs; + }bw2_blank (FB_BLANK_UNBLANK , info);
Signature · 1 line
1.7.11.4
PATCH 8/10 drivers/video/cyber2000fb.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/video/cyber2000fb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/video/cyber2000fb.c +3 -1
@@ -1804,8 +1804,10 @@ cyberpro_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) cfb->irq = dev->irq; cfb->region =pci_ioremap_bar (dev,0 ); -if (!cfb->region) +if (!cfb->region) { + err = -ENOMEM ; goto failed_ioremap; + } cfb->regs = cfb->region +MMIO_OFFSET ; cfb->fb.device = &dev->dev;
Signature · 1 line
1.7.11.4
PATCH 9/10 drivers/video/ps3fb.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/video/ps3fb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/video/ps3fb.c +6 -1
@@ -1034,6 +1034,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)if (status) {dev_err (&dev->core,"%s: lv1_gpu_memory_allocate failed: %d\n" , __func__, status); + retval = -ENOMEM ; goto err_close_device; }dev_dbg (&dev->core,"ddr:lpar:0x%llx\n" , ddr_lpar);
@@ -1046,6 +1047,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)dev_err (&dev->core,"%s: lv1_gpu_context_allocate failed: %d\n" , __func__, status); + retval = -ENOMEM ; goto err_gpu_memory_free; }
@@ -1053,6 +1055,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) dinfo = (void __force *)ioremap (lpar_driver_info,128 *1024 );if (!dinfo) {dev_err (&dev->core,"%s: ioremap failed\n" , __func__); + retval = -ENOMEM ; goto err_gpu_context_free; }
@@ -1121,8 +1124,10 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev) } info =framebuffer_alloc (sizeof (struct ps3fb_par ), &dev->core); -if (!info) +if (!info) { + retval = -ENOMEM ; goto err_context_fb_close; + } par = info->par; par->mode_id = ~ps3fb_mode;/* != ps3fb_mode, to trigger change */
Signature · 1 line
1.7.11.4
PATCH 10/10 drivers/video/arcfb.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/video/arcfb.c | 1 + 1 file changed, 1 insertion(+)
drivers/video/arcfb.c +1 -0
@@ -552,6 +552,7 @@ static int __devinit arcfb_probe(struct platform_device *dev) "arcfb", info)) {printk (KERN_INFO "arcfb: Failed req IRQ %d\n" , par->irq); + retval = -EBUSY ; goto err1; } }
Signature · 1 line
1.7.11.4
Applied all 10 patches of this series.
Thanks,
Florian Tobias Schandinat
Quoted 66 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/video/mb862xx/mb862xxfbdrv.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)drivers/video/mb862xx/mb862xxfbdrv.c +7
-3@@ -1052,12 +1052,14 @@ static int __devinit mb862xx_pci_probe(struct pci_dev *pdev,break ;default :/* should never occur */ + ret = -EIO ; goto rel_reg; } par->fb_base =ioremap (par->fb_base_phys, par->mapped_vram);if (par->fb_base =NULL ) {dev_err (dev,"Cannot map framebuffer\n" ); + ret = -EIO ; goto rel_reg; }@@ -1073,11 +1075,13 @@ static int __devinit mb862xx_pci_probe(struct pci_dev *pdev,dev_dbg (dev,"mmio phys 0x%llx 0x%lx\n" , (unsigned long long )par->mmio_base_phys, (ulong )par->mmio_len); -if (mb862xx_pci_gdc_init (par)) + ret =mb862xx_pci_gdc_init (par); +if (ret) goto io_unmap; -if (request_irq (par->irq, mb862xx_intr,IRQF_SHARED , -DRV_NAME , (void *)par)) { + ret =request_irq (par->irq, mb862xx_intr,IRQF_SHARED , +DRV_NAME , (void *)par); +if (ret) {dev_err (dev,"Cannot request irq\n" ); goto io_unmap; }