diff mbox

powerpc: inline ppc64_runlatch_off

Message ID 20100806132819.GU29316@kryten (mailing list archive)
State Accepted, archived
Commit 4138d65333fa8961714441ed40229ea8cbeaf7e5
Delegated to: Benjamin Herrenschmidt
Headers show

Commit Message

Anton Blanchard Aug. 6, 2010, 1:28 p.m. UTC
Hi Olof,

> No semicolon here.

Nice catch!

Anton

I'm sick of seeing ppc64_runlatch_off in our profiles, so inline it
into the callers. To avoid a mess of circular includes I didn't add
it as an inline function.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Comments

Olof Johansson Aug. 9, 2010, 2:44 a.m. UTC | #1
On Fri, Aug 06, 2010 at 11:28:19PM +1000, Anton Blanchard wrote:
>  
> Hi Olof,
> 
> > No semicolon here.
> 
> Nice catch!
> 
> Anton
> 
> I'm sick of seeing ppc64_runlatch_off in our profiles, so inline it
> into the callers. To avoid a mess of circular includes I didn't add
> it as an inline function.
> 
> Signed-off-by: Anton Blanchard <anton@samba.org>

Acked-by: Olof Johansson <olof@lixom.net>


-Olof
diff mbox

Patch

Index: powerpc.git/arch/powerpc/include/asm/reg.h
===================================================================
--- powerpc.git.orig/arch/powerpc/include/asm/reg.h	2010-08-04 19:55:38.910793475 +1000
+++ powerpc.git/arch/powerpc/include/asm/reg.h	2010-08-04 20:20:19.490751850 +1000
@@ -951,7 +951,14 @@ 
 #ifdef CONFIG_PPC64
 
 extern void ppc64_runlatch_on(void);
-extern void ppc64_runlatch_off(void);
+extern void __ppc64_runlatch_off(void);
+
+#define ppc64_runlatch_off()					\
+	do {							\
+		if (cpu_has_feature(CPU_FTR_CTRL) &&		\
+		    test_thread_flag(TIF_RUNLATCH))		\
+			__ppc64_runlatch_off();			\
+	} while (0)
 
 extern unsigned long scom970_read(unsigned int address);
 extern void scom970_write(unsigned int address, unsigned long value);
Index: powerpc.git/arch/powerpc/kernel/process.c
===================================================================
--- powerpc.git.orig/arch/powerpc/kernel/process.c	2010-08-04 19:55:38.890747120 +1000
+++ powerpc.git/arch/powerpc/kernel/process.c	2010-08-04 20:15:27.573241044 +1000
@@ -1198,19 +1198,17 @@  void ppc64_runlatch_on(void)
 	}
 }
 
-void ppc64_runlatch_off(void)
+void __ppc64_runlatch_off(void)
 {
 	unsigned long ctrl;
 
-	if (cpu_has_feature(CPU_FTR_CTRL) && test_thread_flag(TIF_RUNLATCH)) {
-		HMT_medium();
+	HMT_medium();
 
-		clear_thread_flag(TIF_RUNLATCH);
+	clear_thread_flag(TIF_RUNLATCH);
 
-		ctrl = mfspr(SPRN_CTRLF);
-		ctrl &= ~CTRL_RUNLATCH;
-		mtspr(SPRN_CTRLT, ctrl);
-	}
+	ctrl = mfspr(SPRN_CTRLF);
+	ctrl &= ~CTRL_RUNLATCH;
+	mtspr(SPRN_CTRLT, ctrl);
 }
 #endif