提交 b9c015d4 编写于 作者: J Jacob Keller 提交者: Jeff Kirsher

i40e: mark the value passed to csum_replace_by_diff as __wsum

Fix, or rather, avoid a sparse warning caused by the fact that
csum_replace_by_diff expects to receive a __wsum value. Since the
calculation appears to work, simply typecast the passed paylen value to
__wsum to avoid the warning.

This seems pretty fishy since __wsum was obviously annotated as
a separate type on purpose, so this throws the entire calculation into
question. Since it currently appears to behave as expected, the typecast
is probably safe.

Change-ID: I4fdc5cddd589abc16098176e8a61127e761488f4
Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 ae136708
...@@ -2335,7 +2335,8 @@ static int i40e_tso(struct i40e_tx_buffer *first, u8 *hdr_len, ...@@ -2335,7 +2335,8 @@ static int i40e_tso(struct i40e_tx_buffer *first, u8 *hdr_len,
/* remove payload length from outer checksum */ /* remove payload length from outer checksum */
paylen = skb->len - l4_offset; paylen = skb->len - l4_offset;
csum_replace_by_diff(&l4.udp->check, htonl(paylen)); csum_replace_by_diff(&l4.udp->check,
(__force __wsum)htonl(paylen));
} }
/* reset pointers to inner headers */ /* reset pointers to inner headers */
...@@ -2356,7 +2357,7 @@ static int i40e_tso(struct i40e_tx_buffer *first, u8 *hdr_len, ...@@ -2356,7 +2357,7 @@ static int i40e_tso(struct i40e_tx_buffer *first, u8 *hdr_len,
/* remove payload length from inner checksum */ /* remove payload length from inner checksum */
paylen = skb->len - l4_offset; 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));
/* compute length of segmentation header */ /* compute length of segmentation header */
*hdr_len = (l4.tcp->doff * 4) + l4_offset; *hdr_len = (l4.tcp->doff * 4) + l4_offset;
......
...@@ -1629,7 +1629,8 @@ static int i40e_tso(struct i40e_tx_buffer *first, u8 *hdr_len, ...@@ -1629,7 +1629,8 @@ static int i40e_tso(struct i40e_tx_buffer *first, u8 *hdr_len,
/* remove payload length from outer checksum */ /* remove payload length from outer checksum */
paylen = skb->len - l4_offset; paylen = skb->len - l4_offset;
csum_replace_by_diff(&l4.udp->check, htonl(paylen)); csum_replace_by_diff(&l4.udp->check,
(__force __wsum)htonl(paylen));
} }
/* reset pointers to inner headers */ /* reset pointers to inner headers */
...@@ -1650,7 +1651,7 @@ static int i40e_tso(struct i40e_tx_buffer *first, u8 *hdr_len, ...@@ -1650,7 +1651,7 @@ static int i40e_tso(struct i40e_tx_buffer *first, u8 *hdr_len,
/* remove payload length from inner checksum */ /* remove payload length from inner checksum */
paylen = skb->len - l4_offset; 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));
/* compute length of segmentation header */ /* compute length of segmentation header */
*hdr_len = (l4.tcp->doff * 4) + l4_offset; *hdr_len = (l4.tcp->doff * 4) + l4_offset;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册