From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Lively Subject: [PATCH] make perfc_valuea actually return the value it reads Date: Fri, 26 May 2006 11:14:39 -0400 Message-ID: <44771B5F.6060901@virtualiron.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010000060700000207040302" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------010000060700000207040302 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit The perfc_valuea macro was effectively a no-op. This trivial patch makes it return the value it reads. --------------010000060700000207040302 Content-Type: text/x-patch; name="perfc_valuea-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="perfc_valuea-fix.patch" Make perfc_valuea actually return the value it reads. Signed-off-by: David Lively 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) \ --------------010000060700000207040302 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------010000060700000207040302--