Skip to contentSkip to conversation

__xchg() should be always_inline

PATCH In review Al Viro 2 participants 2 messages May 15, 2007 – May 16, 2007

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 __xchg() should be always_inline

it depends on elimination of unreachable branches in switch (by object size), so we must declare it always_inline

---
 include/asm-m32r/system.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
include/asm-m32r/system.h +2 -1
index b291b2f..8ee73d3 100644
@@ -10,6 +10,7 @@
  * Copyright (C) 2004, 2006  Hirokazu Takata <takata at linux-m32r.org>
  */
 
+#include <linux/compiler.h>
 #include <asm/assembler.h>
 
 #ifdef __KERNEL__
@@ -154,7 +155,7 @@ extern void  __xchg_called_with_bad_pointer(void);
 #define DCACHE_CLEAR(reg0, reg1, addr)
 #endif	/* CONFIG_CHIP_M32700_TS1 */
 
-static inline unsigned long
+static __always_inline unsigned long
 __xchg(unsigned long x, volatile void * ptr, int size)
 {
 	unsigned long flags;
Signature · 1 line
1.5.0-rc2.GIT
Acked-by on v1 1/1
#1 lore raw

Thank you.

From: Al Viro <[email protected]>
Subject: [PATCH] [m32r] __xchg() should be always_inline
Date: Tue, 15 May 2007 20:37:00 +0100

Quoted 34 lines

it depends on elimination of unreachable branches in switch (by object size), so we must declare it always_inline

---
 include/asm-m32r/system.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
include/asm-m32r/system.h +2 -1
index b291b2f..8ee73d3 100644
@@ -10,6 +10,7 @@
  * Copyright (C) 2004, 2006  Hirokazu Takata <takata at linux-m32r.org>
  */
 
+#include <linux/compiler.h>
 #include <asm/assembler.h>
 
 #ifdef __KERNEL__
@@ -154,7 +155,7 @@ extern void  __xchg_called_with_bad_pointer(void);
 #define DCACHE_CLEAR(reg0, reg1, addr)
 #endif	/* CONFIG_CHIP_M32700_TS1 */
 
-static inline unsigned long
+static __always_inline unsigned long
 __xchg(unsigned long x, volatile void * ptr, int size)
 {
 	unsigned long flags;
Signature · 1 line
1.5.0-rc2.GIT