Skip to contentSkip to conversation

make perfc_valuea actually return the value it reads

PATCH New David Lively 1 participant 1 message May 26, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make perfc_valuea actually return the value it reads

The perfc_valuea macro was effectively a no-op. This trivial patch makes it return the value it reads.

Make perfc_valuea actually return the value it reads.

xen/include/xen/perfc.h +2 -4
diff -r ac4a961f7e64 xen/include/xen/perfc.h
@@ -56,10 +56,8 @@ extern struct perfcounter perfcounters;
 #define perfc_value(x)    atomic_read(&perfcounters.x[0])
 #define perfc_valuec(x)   atomic_read(&perfcounters.x[smp_processor_id()])
 #define perfc_valuea(x,y)                                               \
-    do {                                                                \
-        if ( (y) < (sizeof(perfcounters.x) / sizeof(*perfcounters.x)) ) \
-            atomic_read(&perfcounters.x[y]);                            \
-    } while ( 0 )
+    ( (y) < (sizeof(perfcounters.x) / sizeof(*perfcounters.x)) ?	\
+	atomic_read(&perfcounters.x[y]) : 0 )
 #define perfc_set(x,v)    atomic_set(&perfcounters.x[0], v)
 #define perfc_setc(x,v)   atomic_set(&perfcounters.x[smp_processor_id()], v)
 #define perfc_seta(x,y,v)                                               \

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel