net_sched: fix unused variables in __gnet_stats_copy_basic_cpu()
authorWANG Cong <xiyou.wangcong@gmail.com>
Tue, 7 Oct 2014 00:01:33 +0000 (17:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Oct 2014 04:10:49 +0000 (00:10 -0400)
Probably not a big deal, but we'd better just use the
one we get in retry loop.

Fixes: commit 22e0f8b9322cb1a48b1357e8 ("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>
net/core/gen_stats.c

index 14681b97a4f381b4eff4efcd9dce3430e57921aa..0c08062d1796337f25b9dbc2cbce68d5e3194037 100644 (file)
@@ -106,8 +106,8 @@ __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);
@@ -115,8 +115,8 @@ __gnet_stats_copy_basic_cpu(struct gnet_stats_basic_packed *bstats,
                        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;
        }
 }