]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit11984d858c48e50f1c907e56eb7016e9bf51f4df
tree810c62daffe4b388efb1288ddd82d9c7e6abce38
parent94ec9b494d8626e0addb8b6aa520ae2e6abc649c
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