]> git.baikalelectronics.ru Git - kernel.git/commit
caif: delete unnecessary field initialization
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 15 Feb 2014 07:36:13 +0000 (08:36 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Feb 2014 05:29:23 +0000 (00:29 -0500)
commit8978b923856d1d053603d67286e26fc691d6459b
tree514507e065bac849db1e7838cdde456ef9f7c514
parent1cd6e085b8f7c6dff62df0d8e9d60ee6d26d14c0
caif: delete unnecessary field initialization

On success, the function netdev_alloc_skb initializes the dev field of its
result to its first argument, so this doesn't have to be done in the
calling context.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression skb,privn,e;
@@

skb = netdev_alloc_skb(privn,...);
... when strict
(
-skb->dev = privn;
|
?skb = e
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/caif/caif_serial.c
drivers/net/caif/caif_spi.c