Skip to content
Snippets Groups Projects
Commit 327cdeda authored by Julia Lawall's avatar Julia Lawall Committed by David S. Miller
Browse files

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: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d94b27c8
No related merge requests found
...@@ -204,7 +204,6 @@ static void ldisc_receive(struct tty_struct *tty, const u8 *data, ...@@ -204,7 +204,6 @@ static void ldisc_receive(struct tty_struct *tty, const u8 *data,
skb->protocol = htons(ETH_P_CAIF); skb->protocol = htons(ETH_P_CAIF);
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
skb->dev = ser->dev;
debugfs_rx(ser, data, count); debugfs_rx(ser, data, count);
/* Push received packet up the stack. */ /* Push received packet up the stack. */
ret = netif_rx_ni(skb); ret = netif_rx_ni(skb);
......
...@@ -554,7 +554,6 @@ int cfspi_rxfrm(struct cfspi *cfspi, u8 *buf, size_t len) ...@@ -554,7 +554,6 @@ int cfspi_rxfrm(struct cfspi *cfspi, u8 *buf, size_t len)
skb->protocol = htons(ETH_P_CAIF); skb->protocol = htons(ETH_P_CAIF);
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
skb->dev = cfspi->ndev;
/* /*
* Push received packet up the stack. * Push received packet up the stack.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment