aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/caif
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2014-02-15 02:36:13 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-17 00:29:23 -0500
commit327cdedaf6e6334aeb219df5a68da5e6906ee72e (patch)
tree514507e065bac849db1e7838cdde456ef9f7c514 /drivers/net/caif
parentd94b27c8b65c22c92350629e04266a41774c1fe2 (diff)
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>
Diffstat (limited to 'drivers/net/caif')
-rw-r--r--drivers/net/caif/caif_serial.c1
-rw-r--r--drivers/net/caif/caif_spi.c1
2 files changed, 0 insertions, 2 deletions
diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c
index 88a6a5810ec6..fc73865bb83a 100644
--- a/drivers/net/caif/caif_serial.c
+++ b/drivers/net/caif/caif_serial.c
@@ -204,7 +204,6 @@ static void ldisc_receive(struct tty_struct *tty, const u8 *data,
204 204
205 skb->protocol = htons(ETH_P_CAIF); 205 skb->protocol = htons(ETH_P_CAIF);
206 skb_reset_mac_header(skb); 206 skb_reset_mac_header(skb);
207 skb->dev = ser->dev;
208 debugfs_rx(ser, data, count); 207 debugfs_rx(ser, data, count);
209 /* Push received packet up the stack. */ 208 /* Push received packet up the stack. */
210 ret = netif_rx_ni(skb); 209 ret = netif_rx_ni(skb);
diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c
index 155db68e13ba..ff54c0eb2052 100644
--- a/drivers/net/caif/caif_spi.c
+++ b/drivers/net/caif/caif_spi.c
@@ -554,7 +554,6 @@ int cfspi_rxfrm(struct cfspi *cfspi, u8 *buf, size_t len)
554 554
555 skb->protocol = htons(ETH_P_CAIF); 555 skb->protocol = htons(ETH_P_CAIF);
556 skb_reset_mac_header(skb); 556 skb_reset_mac_header(skb);
557 skb->dev = cfspi->ndev;
558 557
559 /* 558 /*
560 * Push received packet up the stack. 559 * Push received packet up the stack.