mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Lameter <cl@linux-foundation.org>
To: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Tejun Heo <tj@kernel.org>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org
Subject: [RFC local_t removal V2 3/3] Eliminate local_cmpxchg
Date: Thu, 07 Jan 2010 16:35:27 -0600	[thread overview]
Message-ID: <20100107223548.809596875@quilx.com> (raw)
In-Reply-To: <20100107223524.760517016@quilx.com>

[-- Attachment #1: remove_cmpxchg_local --]
[-- Type: text/plain, Size: 4822 bytes --]

cmpxchg_local is the same as local_cmpxchg.
Keep cmpxchg_local and change the 3 occurrences of local_cmpxchg to cmpxchg_local.

Signed-off-by: Christoph Lameter <cl@linux-foundation.org>

---
 arch/alpha/include/asm/local.h   |    3 ---
 arch/m32r/include/asm/local.h    |    2 --
 arch/mips/include/asm/local.h    |    3 ---
 arch/powerpc/include/asm/local.h |    3 ---
 arch/x86/include/asm/local.h     |    3 ---
 include/asm-generic/local.h      |    2 --
 kernel/trace/ring_buffer.c       |    6 +++---
 7 files changed, 3 insertions(+), 19 deletions(-)

Index: linux-2.6/arch/alpha/include/asm/local.h
===================================================================
--- linux-2.6.orig/arch/alpha/include/asm/local.h	2010-01-07 15:27:50.000000000 -0600
+++ linux-2.6/arch/alpha/include/asm/local.h	2010-01-07 15:27:56.000000000 -0600
@@ -25,7 +25,4 @@ static __inline__ long local_add_return(
 #define local_add(i,l)	local_add_return((i),(l))
 #define local_sub(i,l)	local_add_return(-(i),(l))
 
-#define local_cmpxchg(l, o, n) \
-	(cmpxchg_local((l), (o), (n)))
-
 #endif /* _ALPHA_LOCAL_H */
Index: linux-2.6/arch/m32r/include/asm/local.h
===================================================================
--- linux-2.6.orig/arch/m32r/include/asm/local.h	2010-01-07 15:27:33.000000000 -0600
+++ linux-2.6/arch/m32r/include/asm/local.h	2010-01-07 15:27:39.000000000 -0600
@@ -80,8 +80,6 @@ static inline long local_add_return(long
  */
 #define local_dec(l) ((void)local_add_return(-1, (l))
 
-#define local_cmpxchg(l, o, n) (cmpxchg_local((l), (o), (n)))
-
 static inline void local_clear_mask(unsigned long  mask, local_t *addr)
 {
 	unsigned long flags;
Index: linux-2.6/arch/mips/include/asm/local.h
===================================================================
--- linux-2.6.orig/arch/mips/include/asm/local.h	2010-01-07 15:27:21.000000000 -0600
+++ linux-2.6/arch/mips/include/asm/local.h	2010-01-07 15:27:27.000000000 -0600
@@ -57,7 +57,4 @@ static __inline__ long local_add_return(
 #define local_inc(l)	local_add_return(-1, (l))
 #define local_dec(l)	local_add_return(-1, (l))
 
-#define local_cmpxchg(l, o, n) \
-	((long)cmpxchg_local((l), (o), (n)))
-
 #endif /* _ARCH_MIPS_LOCAL_H */
Index: linux-2.6/arch/powerpc/include/asm/local.h
===================================================================
--- linux-2.6.orig/arch/powerpc/include/asm/local.h	2010-01-07 15:27:00.000000000 -0600
+++ linux-2.6/arch/powerpc/include/asm/local.h	2010-01-07 15:27:04.000000000 -0600
@@ -26,7 +26,4 @@ static __inline__ long local_add_return(
 #define local_inc(l)	local_add_return(-1, (l))
 #define local_dec(l)	local_add_return(-1, (l))
 
-#define local_cmpxchg(l, o, n) \
-	(cmpxchg_local((l), (o), (n)))
-
 #endif /* _ARCH_POWERPC_LOCAL_H */
Index: linux-2.6/arch/x86/include/asm/local.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/local.h	2010-01-07 15:26:36.000000000 -0600
+++ linux-2.6/arch/x86/include/asm/local.h	2010-01-07 15:26:45.000000000 -0600
@@ -65,7 +65,4 @@ no_xadd: /* Legacy 386 processor */
 #endif
 }
 
-#define local_cmpxchg(l, o, n) \
-	(cmpxchg_local((l), (o), (n)))
-
 #endif /* _ASM_X86_LOCAL_H */
Index: linux-2.6/include/asm-generic/local.h
===================================================================
--- linux-2.6.orig/include/asm-generic/local.h	2010-01-07 15:28:09.000000000 -0600
+++ linux-2.6/include/asm-generic/local.h	2010-01-07 15:28:39.000000000 -0600
@@ -53,6 +53,4 @@ static inline unsigned long __add_return
 #define local_add(i,l)	local_add_return((i), (l))
 #define local_sub(i,l)	local_add_return(-(i), (l))
 
-#define local_cmpxchg(l, o, n) cmpxchg_local((l), (o), (n))
-
 #endif /* _ASM_GENERIC_LOCAL_i */
Index: linux-2.6/kernel/trace/ring_buffer.c
===================================================================
--- linux-2.6.orig/kernel/trace/ring_buffer.c	2010-01-07 15:25:38.000000000 -0600
+++ linux-2.6/kernel/trace/ring_buffer.c	2010-01-07 15:26:14.000000000 -0600
@@ -853,8 +853,8 @@ static int rb_tail_page_update(struct ri
 		 * cmpxchg to only update if an interrupt did not already
 		 * do it for us. If the cmpxchg fails, we don't care.
 		 */
-		(void)local_cmpxchg(&next_page->write, old_write, val);
-		(void)local_cmpxchg(&next_page->entries, old_entries, eval);
+		(void)cmpxchg_local(&next_page->write, old_write, val);
+		(void)cmpxchg_local(&next_page->entries, old_entries, eval);
 
 		/*
 		 * No need to worry about races with clearing out the commit.
@@ -1952,7 +1952,7 @@ rb_try_to_discard(struct ring_buffer_per
 		 */
 		old_index += write_mask;
 		new_index += write_mask;
-		index = local_cmpxchg(&bpage->write, old_index, new_index);
+		index = cmpxchg_local(&bpage->write, old_index, new_index);
 		if (index == old_index)
 			return 1;
 	}

-- 

      parent reply	other threads:[~2010-01-07 22:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07 22:35 [RFC local_t removal V2 0/3] Remove local_t Christoph Lameter
2010-01-07 22:35 ` [RFC local_t removal V2 1/3] Remove unused local.h functions Christoph Lameter
2010-01-07 22:35 ` [RFC local_t removal V2 2/3] Remove local_t type from tree Christoph Lameter
2010-01-08  8:55   ` Arnd Bergmann
2010-01-07 22:35 ` Christoph Lameter [this message]

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=20100107223548.809596875@quilx.com \
    --to=cl@linux-foundation.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=tj@kernel.org \
    /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

Powered by JetHome