Staging: gdm724x: Remove unnecessary print statements
PATCH 1/1 Staging: gdm724x: Remove unnecessary print statements
Remove print statements that provide information about error messages when memory allocation is failed.
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>
--- drivers/staging/gdm724x/gdm_lte.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/gdm724x/gdm_lte.c +0 -1
@@ -871,7 +871,6 @@ int register_lte_device(struct phy_dev *phy_dev, net =alloc_netdev (sizeof (struct nic ), pdn_dev_name,NET_NAME_UNKNOWN , ether_setup);if (!net) { -pr_err ("alloc_netdev failed\n" ); ret = -ENOMEM ; goto err; }
Signature · 1 line
2.17.1
Quoted 15 lines · Bhanusree Pola
Remove print statements that provide information about error messages when memory allocation is failed.
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\)(...));
Quoted 7 lines
if(x==NULL)
{
...
(
-f(C,...);
|
-f(...,C);
You can also try just f(...,C,...). If you use that, the others are not needed, because ... can match nothing.
Quoted 6 lines
)
...
}
</smpl>Signed-off-by Bhanusree Pola <[email protected]>
Quoted 26 lines
--- drivers/staging/gdm724x/gdm_lte.c | 1 - 1 file changed, 1 deletion(-)drivers/staging/gdm724x/gdm_lte.c +0
-2@@ -871,7 +871,6 @@ int register_lte_device(struct phy_dev *phy_dev, net =alloc_netdev (sizeof (struct nic ), pdn_dev_name,NET_NAME_UNKNOWN , ether_setup);if (!net) { -pr_err ("alloc_netdev failed\n" ); ret = -ENOMEM ; goto err; } --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/20190322124010.7192-1-bhanusreemahesh%40gmail.com.
For more options, visit https://groups.google.com/d/optout.