Skip to content

Commit 02c0fc1

Browse files
congwangdavem330
authored andcommitted
net_sched: fix unused variables in __gnet_stats_copy_basic_cpu()
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 <joe@perches.com> Cc: John Fastabend <john.fastabend@gmail.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 7c5df8f commit 02c0fc1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/core/gen_stats.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,17 @@ __gnet_stats_copy_basic_cpu(struct gnet_stats_basic_packed *bstats,
106106
for_each_possible_cpu(i) {
107107
struct gnet_stats_basic_cpu *bcpu = per_cpu_ptr(cpu, i);
108108
unsigned int start;
109-
__u64 bytes;
110-
__u32 packets;
109+
u64 bytes;
110+
u32 packets;
111111

112112
do {
113113
start = u64_stats_fetch_begin_irq(&bcpu->syncp);
114114
bytes = bcpu->bstats.bytes;
115115
packets = bcpu->bstats.packets;
116116
} while (u64_stats_fetch_retry_irq(&bcpu->syncp, start));
117117

118-
bstats->bytes += bcpu->bstats.bytes;
119-
bstats->packets += bcpu->bstats.packets;
118+
bstats->bytes += bytes;
119+
bstats->packets += packets;
120120
}
121121
}
122122

0 commit comments

Comments
 (0)