Skip to content

Commit

Permalink
net_sched: fix unused variables in __gnet_stats_copy_basic_cpu()
Browse files Browse the repository at this point in the history
Probably not a big deal, but we'd better just use the
one we get in retry loop.

Fixes: commit 22e0f8b ("net: sched: make bstats per cpu and estimator RCU safe")
Reported-by: Joe Perches <[email protected]>
Cc: John Fastabend <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
congwang authored and davem330 committed Oct 7, 2014
1 parent 7c5df8f commit 02c0fc1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/core/gen_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@ __gnet_stats_copy_basic_cpu(struct gnet_stats_basic_packed *bstats,
for_each_possible_cpu(i) {
struct gnet_stats_basic_cpu *bcpu = per_cpu_ptr(cpu, i);
unsigned int start;
__u64 bytes;
__u32 packets;
u64 bytes;
u32 packets;

do {
start = u64_stats_fetch_begin_irq(&bcpu->syncp);
bytes = bcpu->bstats.bytes;
packets = bcpu->bstats.packets;
} while (u64_stats_fetch_retry_irq(&bcpu->syncp, start));

bstats->bytes += bcpu->bstats.bytes;
bstats->packets += bcpu->bstats.packets;
bstats->bytes += bytes;
bstats->packets += packets;
}
}

Expand Down

0 comments on commit 02c0fc1

Please sign in to comment.