Skip to content

Commit eb19b55

Browse files
jacob-kellerSomasundaram Krishnasamy
authored andcommitted
fm10k: use a local variable for the frag pointer
In the function fm10k_xmit_frame_ring, we recently switched to using the skb_frag_size accessor instead of directly using the size member of the skb fragment. This made the for loop slightly harder to read because it created a very long line that is difficult to split up. Avoid this by using a local variable in the for loop, so that we do not have to break the line on an open parenthesis. Signed-off-by: Jacob Keller <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> (cherry picked from commit 0ea7e88) Orabug: 31268827 Signed-off-by: Jack Vogel <[email protected]> Reviewed-by: John Donnelly <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent 3bccd69 commit eb19b55

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/net/ethernet/intel/fm10k/fm10k_main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,8 +1081,11 @@ netdev_tx_t fm10k_xmit_frame_ring(struct sk_buff *skb,
10811081
* + 2 desc gap to keep tail from touching head
10821082
* otherwise try next time
10831083
*/
1084-
for (f = 0; f < skb_shinfo(skb)->nr_frags; f++)
1085-
count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size);
1084+
for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
1085+
skb_frag_t *frag = &skb_shinfo(skb)->frags[f];
1086+
1087+
count += TXD_USE_COUNT(skb_frag_size(frag));
1088+
}
10861089

10871090
if (fm10k_maybe_stop_tx(tx_ring, count + 3)) {
10881091
tx_ring->tx_stats.tx_busy++;

0 commit comments

Comments
 (0)