All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] make perfc_valuea actually return the value it reads
@ 2006-05-26 15:14 David Lively
  0 siblings, 0 replies; only message in thread
From: David Lively @ 2006-05-26 15:14 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 106 bytes --]

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



[-- Attachment #2: perfc_valuea-fix.patch --]
[-- Type: text/x-patch, Size: 1112 bytes --]

Make perfc_valuea actually return the value it reads.

Signed-off-by: David Lively <dlively@virtualiron.com>

diff -r ac4a961f7e64 xen/include/xen/perfc.h
--- a/xen/include/xen/perfc.h	Thu May 25 22:57:44 2006 +0100
+++ b/xen/include/xen/perfc.h	Fri May 26 11:10:33 2006 -0400
@@ -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)                                               \

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-26 15:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-26 15:14 [PATCH] make perfc_valuea actually return the value it reads David Lively

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.