]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: qualcomm: rmnet: Use skb_put_zero() to simplify code
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 20 Feb 2022 06:36:59 +0000 (07:36 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Feb 2022 11:58:48 +0000 (11:58 +0000)
Use skb_put_zero() instead of hand-writing it. This saves a few lines of
code and is more readable.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c

index 3676976c875bc9cc20c7c086c01a9abeeb617735..ba194698cc142dd58261e46f58c3357671c560ac 100644 (file)
@@ -298,7 +298,6 @@ struct rmnet_map_header *rmnet_map_add_map_header(struct sk_buff *skb,
 {
        struct rmnet_map_header *map_header;
        u32 padding, map_datalen;
-       u8 *padbytes;
 
        map_datalen = skb->len - hdrlen;
        map_header = (struct rmnet_map_header *)
@@ -323,8 +322,7 @@ struct rmnet_map_header *rmnet_map_add_map_header(struct sk_buff *skb,
        if (skb_tailroom(skb) < padding)
                return NULL;
 
-       padbytes = (u8 *)skb_put(skb, padding);
-       memset(padbytes, 0, padding);
+       skb_put_zero(skb, padding);
 
 done:
        map_header->pkt_len = htons(map_datalen + padding);