Skip to contentSkip to conversation

Staging: media: imx: imx6-mipi-csi2.c Remove unnecessary error messages

PATCH Superseded Bhanusree Pola 3 participants 3 messages Mar 22, 2019 – Mar 25, 2019

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: media: imx: imx6-mipi-csi2.c Remove unnecessary error messages

The function devm_ioremap already prints error message when there is no enough memory.
Remove print statements that give error messages
Issue found using coccinelle
The following semantic patch is used to solve this:

<smpl>
@@
expression x;
constant char[] C;
identifier f;
@@

x = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\| usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\)(...));

if(x==NULL)
{
...
(
-f(C,...);
|
-f(...,C);
)
...
}
</smpl>

---
v2:
-subject line modified
-commit log modified

 drivers/staging/media/imx/imx6-mipi-csi2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/media/imx/imx6-mipi-csi2.c +1 -3
index 6a1cee55a49b..2c5e3dd58cea 100644
@@ -628,10 +628,8 @@ static int csi2_probe(struct platform_device *pdev)
 	}
 
 	csi2->base = devm_ioremap(&pdev->dev, res->start, PAGE_SIZE);
-	if (!csi2->base) {
-		v4l2_err(&csi2->sd, "failed to map CSI-2 registers\n");
+	if (!csi2->base)
 		return -ENOMEM;
-	}
 
 	mutex_init(&csi2->lock);
 
Signature · 1 line
2.17.1
#1 lore raw

It's not normal to put the file name in the subject line. There aren't many examples on this file, but maybe:

media: imx: mipi csi-2:

julia

Quoted 63 lines · Bhanusree Pola

The function devm_ioremap already prints error message when there is no enough memory.
Remove print statements that give error messages
Issue found using coccinelle
The following semantic patch is used to solve this:

<smpl>
@@
expression x;
constant char[] C;
identifier f;
@@

x = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\| usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\)(...));

if(x==NULL)
{
...
(
-f(C,...);
|
-f(...,C);
)
...
}
</smpl>

---
v2:
-subject line modified
-commit log modified

 drivers/staging/media/imx/imx6-mipi-csi2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/media/imx/imx6-mipi-csi2.c +1 -4
index 6a1cee55a49b..2c5e3dd58cea 100644
@@ -628,10 +628,8 @@ static int csi2_probe(struct platform_device *pdev)
 	}
 
 	csi2->base = devm_ioremap(&pdev->dev, res->start, PAGE_SIZE);
-	if (!csi2->base) {
-		v4l2_err(&csi2->sd, "failed to map CSI-2 registers\n");
+	if (!csi2->base)
 		return -ENOMEM;
-	}
 
 	mutex_init(&csi2->lock);
 
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190322154035.9014-1-bhanusreemahesh%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

reviewer Reviewed-by on v2 1/1
#2 lore raw
In reply to Bhanusree Pola
Quoted 29 lines · Bhanusree Pola

The function devm_ioremap already prints error message when there is no enough memory.
Remove print statements that give error messages
Issue found using coccinelle
The following semantic patch is used to solve this:

<smpl>
@@
expression x;
constant char[] C;
identifier f;
@@

x = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\| usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\)(...));

if(x==NULL)
{
...
(
-f(C,...);
|
-f(...,C);
)
...
}
</smpl>

Quoted 1 line