net: qualcomm: rmnet: get rid of some local variables
authorAlex Elder <elder@linaro.org>
Fri, 11 Jun 2021 19:05:24 +0000 (14:05 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Jun 2021 20:37:49 +0000 (13:37 -0700)
The value passed as an argument to rmnet_map_ipv4_ul_csum_header()
is always an IPv4 header.  Rather than using a local variable, just
have the type of the argument reflect the proper type.

In rmnet_map_ipv6_ul_csum_header() things are defined a little
differently, but make the same basic change there.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c

index b8e504a..ca07b87 100644 (file)
@@ -195,15 +195,14 @@ static void rmnet_map_complement_ipv4_txporthdr_csum_field(void *iphdr)
 }
 
 static void
-rmnet_map_ipv4_ul_csum_header(void *iphdr,
+rmnet_map_ipv4_ul_csum_header(struct iphdr *iphdr,
                              struct rmnet_map_ul_csum_header *ul_header,
                              struct sk_buff *skb)
 {
-       struct iphdr *ip4h = iphdr;
        u16 val;
 
        val = MAP_CSUM_UL_ENABLED_FLAG;
-       if (ip4h->protocol == IPPROTO_UDP)
+       if (iphdr->protocol == IPPROTO_UDP)
                val |= MAP_CSUM_UL_UDP_FLAG;
        val |= skb->csum_offset & MAP_CSUM_UL_OFFSET_MASK;
 
@@ -231,15 +230,14 @@ static void rmnet_map_complement_ipv6_txporthdr_csum_field(void *ip6hdr)
 }
 
 static void
-rmnet_map_ipv6_ul_csum_header(void *ip6hdr,
+rmnet_map_ipv6_ul_csum_header(struct ipv6hdr *ipv6hdr,
                              struct rmnet_map_ul_csum_header *ul_header,
                              struct sk_buff *skb)
 {
-       struct ipv6hdr *ip6h = ip6hdr;
        u16 val;
 
        val = MAP_CSUM_UL_ENABLED_FLAG;
-       if (ip6h->nexthdr == IPPROTO_UDP)
+       if (ipv6hdr->nexthdr == IPPROTO_UDP)
                val |= MAP_CSUM_UL_UDP_FLAG;
        val |= skb->csum_offset & MAP_CSUM_UL_OFFSET_MASK;
 
@@ -248,7 +246,7 @@ rmnet_map_ipv6_ul_csum_header(void *ip6hdr,
 
        skb->ip_summed = CHECKSUM_NONE;
 
-       rmnet_map_complement_ipv6_txporthdr_csum_field(ip6hdr);
+       rmnet_map_complement_ipv6_txporthdr_csum_field(ipv6hdr);
 }
 #endif