From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQNOX-00045J-Fk for qemu-devel@nongnu.org; Tue, 24 Feb 2015 16:52:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQNON-0006gQ-9t for qemu-devel@nongnu.org; Tue, 24 Feb 2015 16:51:57 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:44845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQNON-0006gC-5K for qemu-devel@nongnu.org; Tue, 24 Feb 2015 16:51:47 -0500 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Feb 2015 16:51:46 -0500 From: Michael Roth Date: Tue, 24 Feb 2015 15:47:58 -0600 Message-Id: <1424814498-6993-24-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1424814498-6993-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1424814498-6993-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 23/43] atomic: fix position of volatile qualifier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , qemu-stable@nongnu.org From: Paolo Bonzini What needs to be volatile is not the pointer, but the pointed-to value! Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini (cherry picked from commit 2cbcfb281afa041a41f6e4c4da0f5c9314084604) Signed-off-by: Michael Roth --- include/qemu/atomic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index 492bce1..93c2ae2 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -122,11 +122,11 @@ #endif #ifndef atomic_read -#define atomic_read(ptr) (*(__typeof__(*ptr) *volatile) (ptr)) +#define atomic_read(ptr) (*(__typeof__(*ptr) volatile*) (ptr)) #endif #ifndef atomic_set -#define atomic_set(ptr, i) ((*(__typeof__(*ptr) *volatile) (ptr)) = (i)) +#define atomic_set(ptr, i) ((*(__typeof__(*ptr) volatile*) (ptr)) = (i)) #endif /* These have the same semantics as Java volatile variables. -- 1.9.1