diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index 01cff073f8db..5bef5b0f00d9 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c @@ -2305,7 +2305,8 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb, /* remove payload length from outer checksum */ paylen = (__force u16)l4.udp->check; - paylen += ntohs(1) * (u16)~(skb->len - l4_offset); + paylen += ntohs((__force __be16)1) * + (u16)~(skb->len - l4_offset); l4.udp->check = ~csum_fold((__force __wsum)paylen); } @@ -2327,7 +2328,7 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb, /* remove payload length from inner checksum */ paylen = (__force u16)l4.tcp->check; - paylen += ntohs(1) * (u16)~(skb->len - l4_offset); + paylen += ntohs((__force __be16)1) * (u16)~(skb->len - l4_offset); l4.tcp->check = ~csum_fold((__force __wsum)paylen); /* compute length of segmentation header */ diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c index 9e911363c11b..570348d93e5d 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c @@ -1572,7 +1572,8 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb, /* remove payload length from outer checksum */ paylen = (__force u16)l4.udp->check; - paylen += ntohs(1) * (u16)~(skb->len - l4_offset); + paylen += ntohs((__force __be16)1) * + (u16)~(skb->len - l4_offset); l4.udp->check = ~csum_fold((__force __wsum)paylen); } @@ -1594,7 +1595,7 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb, /* remove payload length from inner checksum */ paylen = (__force u16)l4.tcp->check; - paylen += ntohs(1) * (u16)~(skb->len - l4_offset); + paylen += ntohs((__force __be16)1) * (u16)~(skb->len - l4_offset); l4.tcp->check = ~csum_fold((__force __wsum)paylen); /* compute length of segmentation header */