* [Intel-wired-lan] [PATCH] fm10k: use a local variable for the frag pointer
@ 2019-07-23 16:08 Jacob Keller
2019-07-31 17:55 ` Bowers, AndrewX
0 siblings, 1 reply; 2+ messages in thread
From: Jacob Keller @ 2019-07-23 16:08 UTC (permalink / raw)
To: intel-wired-lan
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 <jacob.e.keller@intel.com>
---
drivers/net/ethernet/intel/fm10k/fm10k_main.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
index e0a2be534b20..2be9222510e7 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
@@ -1073,9 +1073,11 @@ netdev_tx_t fm10k_xmit_frame_ring(struct sk_buff *skb,
* + 2 desc gap to keep tail from touching head
* otherwise try next time
*/
- for (f = 0; f < skb_shinfo(skb)->nr_frags; f++)
- count += TXD_USE_COUNT(skb_frag_size(
- &skb_shinfo(skb)->frags[f]));
+ for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
+ skb_frag_t *frag = &skb_shinfo(skb)->frags[f];
+
+ count += TXD_USE_COUNT(skb_frag_size(frag));
+ }
if (fm10k_maybe_stop_tx(tx_ring, count + 3)) {
tx_ring->tx_stats.tx_busy++;
--
2.22.0.214.g8dca754b1e87
^ permalink raw reply related [flat|nested] 2+ messages in thread* [Intel-wired-lan] [PATCH] fm10k: use a local variable for the frag pointer
2019-07-23 16:08 [Intel-wired-lan] [PATCH] fm10k: use a local variable for the frag pointer Jacob Keller
@ 2019-07-31 17:55 ` Bowers, AndrewX
0 siblings, 0 replies; 2+ messages in thread
From: Bowers, AndrewX @ 2019-07-31 17:55 UTC (permalink / raw)
To: intel-wired-lan
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Jacob Keller
> Sent: Tuesday, July 23, 2019 9:09 AM
> To: Intel Wired LAN <intel-wired-lan@lists.osuosl.org>
> Subject: [Intel-wired-lan] [PATCH] 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 <jacob.e.keller@intel.com>
> ---
> drivers/net/ethernet/intel/fm10k/fm10k_main.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-31 17:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-23 16:08 [Intel-wired-lan] [PATCH] fm10k: use a local variable for the frag pointer Jacob Keller
2019-07-31 17:55 ` Bowers, AndrewX
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox