mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-kernel@vger.kernel.org
Cc: linux-arch@vger.kernel.org,
	Mathieu Lacage <mathieu.lacage@sophia.inria.fr>,
	Mathieu Lacage <mathieu.lacage@inria.fr>,
	Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 2/6] asm-generic: cmpxchg does not handle non-long arguments
Date: Sat,  9 Oct 2010 21:57:48 +0200	[thread overview]
Message-ID: <1286654272-21483-3-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1286654272-21483-1-git-send-email-arnd@arndb.de>

From: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>

The version of cmpxchg defined in asm-generic/system.h does not handle
correctly non-long arguments. Use the version defined in cmpxchg.h
instead.

Signed-off-by: Mathieu Lacage <mathieu.lacage@inria.fr>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/asm-generic/system.h |   20 +-------------------
 1 files changed, 1 insertions(+), 19 deletions(-)

diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h
index efa403b..4b0b9cb 100644
--- a/include/asm-generic/system.h
+++ b/include/asm-generic/system.h
@@ -21,6 +21,7 @@
 #include <linux/irqflags.h>
 
 #include <asm/cmpxchg-local.h>
+#include <asm/cmpxchg.h>
 
 struct task_struct;
 
@@ -136,25 +137,6 @@ unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
 #define xchg(ptr, x) \
 	((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
 
-static inline unsigned long __cmpxchg(volatile unsigned long *m,
-				      unsigned long old, unsigned long new)
-{
-	unsigned long retval;
-	unsigned long flags;
-
-	local_irq_save(flags);
-	retval = *m;
-	if (retval == old)
-		*m = new;
-	local_irq_restore(flags);
-	return retval;
-}
-
-#define cmpxchg(ptr, o, n)					\
-	((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \
-					(unsigned long)(o),	\
-					(unsigned long)(n)))
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
-- 
1.7.1


  parent reply	other threads:[~2010-10-09 19:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-09 19:57 [PATCH 0/6] asm-generic updates for 2.6.37 Arnd Bergmann
2010-10-09 19:57 ` [PATCH 1/6] asm-generic: make atomic_add_unless a function Arnd Bergmann
2010-10-09 19:57 ` Arnd Bergmann [this message]
2010-10-09 19:57 ` [PATCH 3/6] asm-generic: fcntl: make exported headers use strict posix types Arnd Bergmann
2010-10-09 19:57 ` [PATCH 4/6] asm-generic: kdebug.h: Checkpatch cleanup Arnd Bergmann
2010-10-09 19:57 ` [PATCH 5/6] bitops: make asm-generic/bitops/find.h more generic Arnd Bergmann
2010-10-09 19:57 ` [PATCH 6/6] bitops: remove duplicated extern declarations Arnd Bergmann

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=1286654272-21483-3-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.lacage@inria.fr \
    --cc=mathieu.lacage@sophia.inria.fr \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®