Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Inline ppc64_runlatch_off

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>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Anton Blanchard and committed by
Benjamin Herrenschmidt
4138d653 954e6da5

+14 -9
+8 -1
arch/powerpc/include/asm/reg.h
··· 951 951 #ifdef CONFIG_PPC64 952 952 953 953 extern void ppc64_runlatch_on(void); 954 - extern void ppc64_runlatch_off(void); 954 + extern void __ppc64_runlatch_off(void); 955 + 956 + #define ppc64_runlatch_off() \ 957 + do { \ 958 + if (cpu_has_feature(CPU_FTR_CTRL) && \ 959 + test_thread_flag(TIF_RUNLATCH)) \ 960 + __ppc64_runlatch_off(); \ 961 + } while (0) 955 962 956 963 extern unsigned long scom970_read(unsigned int address); 957 964 extern void scom970_write(unsigned int address, unsigned long value);
+6 -8
arch/powerpc/kernel/process.c
··· 1199 1199 } 1200 1200 } 1201 1201 1202 - void ppc64_runlatch_off(void) 1202 + void __ppc64_runlatch_off(void) 1203 1203 { 1204 1204 unsigned long ctrl; 1205 1205 1206 - if (cpu_has_feature(CPU_FTR_CTRL) && test_thread_flag(TIF_RUNLATCH)) { 1207 - HMT_medium(); 1206 + HMT_medium(); 1208 1207 1209 - clear_thread_flag(TIF_RUNLATCH); 1208 + clear_thread_flag(TIF_RUNLATCH); 1210 1209 1211 - ctrl = mfspr(SPRN_CTRLF); 1212 - ctrl &= ~CTRL_RUNLATCH; 1213 - mtspr(SPRN_CTRLT, ctrl); 1214 - } 1210 + ctrl = mfspr(SPRN_CTRLF); 1211 + ctrl &= ~CTRL_RUNLATCH; 1212 + mtspr(SPRN_CTRLT, ctrl); 1215 1213 } 1216 1214 #endif 1217 1215