From: Julia Lawall Date: Sat, 15 Feb 2014 07:36:13 +0000 (+0100) Subject: caif: delete unnecessary field initialization X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=327cdedaf6e6334aeb219df5a68da5e6906ee72e;p=deliverable%2Flinux.git 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/) // @@ expression skb,privn,e; @@ skb = netdev_alloc_skb(privn,...); ... when strict ( -skb->dev = privn; | ?skb = e ) // Signed-off-by: Julia Lawall Signed-off-by: David S. Miller --- 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, skb->protocol = htons(ETH_P_CAIF); skb_reset_mac_header(skb); - skb->dev = ser->dev; debugfs_rx(ser, data, count); /* Push received packet up the stack. */ 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) skb->protocol = htons(ETH_P_CAIF); skb_reset_mac_header(skb); - skb->dev = cfspi->ndev; /* * Push received packet up the stack.