From: Jesse Brandeburg Date: Fri, 26 Mar 2021 00:38:31 +0000 (-0700) Subject: intel: call csum functions with well formatted arguments X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=de8447131d2b1923a91c4c30bf094422dfcc16bf;p=kernel.git intel: call csum functions with well formatted arguments The sparse build (C=2) found that there were two drivers who had not been convered to call the csum_replace_by_diff() function with sparse clean arguments. Most if not all drivers force the cast like this patch does. So these drivers are now joining the party (a bit late), but with no functional change. Signed-off-by: Jesse Brandeburg Signed-off-by: Tony Nguyen --- diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c index 630c1155f1965..1bbe9862a758a 100644 --- a/drivers/net/ethernet/intel/igbvf/netdev.c +++ b/drivers/net/ethernet/intel/igbvf/netdev.c @@ -2056,7 +2056,7 @@ static int igbvf_tso(struct igbvf_ring *tx_ring, /* remove payload length from inner checksum */ paylen = skb->len - l4_offset; - csum_replace_by_diff(&l4.tcp->check, htonl(paylen)); + csum_replace_by_diff(&l4.tcp->check, (__force __wsum)htonl(paylen)); /* MSS L4LEN IDX */ mss_l4len_idx = (*hdr_len - l4_offset) << E1000_ADVTXD_L4LEN_SHIFT; diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index ba2ed8a43d2de..588c3aa50d94d 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c @@ -3814,7 +3814,7 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring, /* remove payload length from inner checksum */ paylen = skb->len - l4_offset; - csum_replace_by_diff(&l4.tcp->check, htonl(paylen)); + csum_replace_by_diff(&l4.tcp->check, (__force __wsum)htonl(paylen)); /* update gso size and bytecount with header size */ first->gso_segs = skb_shinfo(skb)->gso_segs;