[cpuops inc_return V1 9/9] Xen: Use this_cpu_inc_return

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Christoph Lameter
Date: Monday, December 6, 2010 - 10:40 am

__this_cpu_inc_return reduces code and simplifies code.

Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Christoph Lameter <cl@linux.com>

---
 drivers/xen/events.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/drivers/xen/events.c
===================================================================
--- linux-2.6.orig/drivers/xen/events.c	2010-12-06 11:00:18.000000000 -0600
+++ linux-2.6/drivers/xen/events.c	2010-12-06 11:00:47.000000000 -0600
@@ -1109,7 +1109,7 @@ static void __xen_evtchn_do_upcall(void)
 
 		vcpu_info->evtchn_upcall_pending = 0;
 
-		if (__get_cpu_var(xed_nesting_count)++)
+		if (__this_cpu_inc_return(xed_nesting_count) - 1)
 			goto out;
 
 #ifndef CONFIG_X86 /* No need for a barrier -- XCHG is a barrier on x86. */

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[cpuops inc_return V1 9/9] Xen: Use this_cpu_inc_return, Christoph Lameter, (Mon Dec 6, 10:40 am)