From patchwork Fri Aug 6 04:53:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 61063 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 4E965100A2B for ; Fri, 6 Aug 2010 14:53:38 +1000 (EST) Received: by ozlabs.org (Postfix) id C0C6F1007D2; Fri, 6 Aug 2010 14:53:32 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: by ozlabs.org (Postfix, from userid 1010) id BF6741007D1; Fri, 6 Aug 2010 14:53:32 +1000 (EST) Date: Fri, 6 Aug 2010 14:53:15 +1000 From: Anton Blanchard To: benh@kernel.crashing.org Subject: [PATCH] powerpc: inline ppc64_runlatch_off Message-ID: <20100806045315.GR29316@kryten> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Cc: linuxppc-dev@ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org I'm sick of seeing ppc64_runlatch_off in our profiles, so inline the heavily used part of 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 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