[ovs-dev] [PATCH] coverage: Make thread-safe.

Ben Pfaff blp at nicira.com
Tue Aug 20 20:44:54 UTC 2013


On Mon, Aug 19, 2013 at 12:32:06PM -0700, Alex Wang wrote:
> Just noticed, when compiling with sparse, it issues the warnings like:
> 
> """
> lib/netdev-linux.c:76:1: warning: symbol 'counter_netdev_set_policing' was
> not declared. Should it be static?
> lib/netdev-linux.c:77:1: warning: symbol 'counter_netdev_arp_lookup' was
> not declared. Should it be static?
> lib/netdev-linux.c:78:1: warning: symbol 'counter_netdev_get_ifindex' was
> not declared. Should it be static?
> """

Ouch, thanks, I folded in this incremental to fix that:

diff --git a/lib/coverage.h b/lib/coverage.h
index 73b027a..3d1a115 100644
--- a/lib/coverage.h
+++ b/lib/coverage.h
@@ -54,6 +54,7 @@ struct coverage_counter {
         {                                                               \
             *counter_##COUNTER##_get() += n;                            \
         }                                                               \
+        extern struct coverage_counter counter_##COUNTER;               \
         struct coverage_counter counter_##COUNTER                       \
             = { #COUNTER, COUNTER##_count, 0 };                         \
         extern struct coverage_counter *counter_ptr_##COUNTER;          \



More information about the dev mailing list