staging: netlogic: replace skb_put/pull pair with skb_reserve
authorIvan Safonov <insafonov@gmail.com>
Wed, 20 Mar 2019 12:45:19 +0000 (15:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Mar 2019 07:25:00 +0000 (08:25 +0100)
The sequence

    skb_put(skb);
    skb_pull(skb);

leads to the same result as

    skb_reserve(skb);

but second is a little shorter and clearer.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/netlogic/xlr_net.c

index 10f14a5cf4906d13409d81e6e5b9739c8dff5b0f..1897b711d66d195fa38d2c525cdf801acbd062df 100644 (file)
@@ -87,8 +87,7 @@ static inline unsigned char *xlr_alloc_skb(void)
        if (!skb)
                return NULL;
        skb_data = skb->data;
-       skb_put(skb, MAC_SKB_BACK_PTR_SIZE);
-       skb_pull(skb, MAC_SKB_BACK_PTR_SIZE);
+       skb_reserve(skb, MAC_SKB_BACK_PTR_SIZE);
        memcpy(skb_data, &skb, buf_len);
 
        return skb->data;