All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Lively <dlively@virtualiron.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] make perfc_valuea actually return the value it reads
Date: Fri, 26 May 2006 11:14:39 -0400	[thread overview]
Message-ID: <44771B5F.6060901@virtualiron.com> (raw)

[-- 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

                 reply	other threads:[~2006-05-26 15:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44771B5F.6060901@virtualiron.com \
    --to=dlively@virtualiron.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.