net: qualcomm: rmnet: clarify a bit of code
authorAlex Elder <elder@linaro.org>
Fri, 11 Jun 2021 19:05:27 +0000 (14:05 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Jun 2021 20:37:49 +0000 (13:37 -0700)
commite5adbbdfa2fb17e3d266011cef816ee492235581
tree810c62daffe4b388efb1288ddd82d9c7e6abce38
parent16bf3d33c6b042c894747b96580db392b7e6c0c0
net: qualcomm: rmnet: clarify a bit of code

In rmnet_map_ipv6_dl_csum_trailer() there is an especially involved
line of code that determines the ones' complement sum of the IPv6
packet header (in host byte order).  Simplify that by storing the
result of computing just the header checksum in a local variable,
then using that in the original assignment.

Use the size of the IPv6 header structure as the number of bytes to
checksum, rather than computing the offset to the transport header.
And use ip_fast_csum() rather than ipa_compute_csum(), knowing that
the size of an IPv6 header (40 bytes) is a multiple of 4 bytes
greater than 16.

Add some comments to match rmnet_map_ipv4_dl_csum_trailer().

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