Re: [PATCH 6/8] net: qualcomm: rmnet: get rid of a variable in rmnet_map_ipv4_ul_csum_header()
From: Bjorn Andersson
Date: Mon May 20 2019 - 13:19:40 EST
On Mon 20 May 06:53 PDT 2019, Alex Elder wrote:
> The value passed as an argument to rmnet_map_ipv4_ul_csum_header()
> is always an IPv4 header. Just have the type of the argument
> reflect that rather than obscuring that with a void pointer. Rename
> it to be consistent with rmnet_map_ipv6_ul_csum_header().
>
> Signed-off-by: Alex Elder <elder@xxxxxxxxxx>
Reviewed-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>
> ---
> drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
> index a95111cdcd29..61b7dbab2056 100644
> --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
> +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
> @@ -203,26 +203,25 @@ 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 *ip4hdr,
> struct rmnet_map_ul_csum_header *ul_header,
> struct sk_buff *skb)
> {
> - struct iphdr *ip4h = iphdr;
> u16 offset;
> u16 val;
>
> - offset = skb_transport_header(skb) - (unsigned char *)iphdr;
> + offset = skb_transport_header(skb) - (unsigned char *)ip4hdr;
> ul_header->csum_start_offset = htons(offset);
>
> val = u16_encode_bits(skb->csum_offset, RMNET_MAP_UL_CSUM_INSERT_FMASK);
> val |= RMNET_MAP_UL_CSUM_ENABLED_FMASK;
> - if (ip4h->protocol == IPPROTO_UDP)
> + if (ip4hdr->protocol == IPPROTO_UDP)
> val |= RMNET_MAP_UL_CSUM_UDP_FMASK;
> ul_header->csum_info = htons(val);
>
> skb->ip_summed = CHECKSUM_NONE;
>
> - rmnet_map_complement_ipv4_txporthdr_csum_field(iphdr);
> + rmnet_map_complement_ipv4_txporthdr_csum_field(ip4hdr);
> }
>
> #if IS_ENABLED(CONFIG_IPV6)
> --
> 2.20.1
>