From patchwork Mon Aug 24 11:20:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hao X-Patchwork-Id: 509997 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0C54B1402A0 for ; Mon, 24 Aug 2015 21:27:20 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=xTxrfW+f; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id D71151A2B05 for ; Mon, 24 Aug 2015 21:27:19 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=xTxrfW+f; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-yk0-x22e.google.com (mail-yk0-x22e.google.com [IPv6:2607:f8b0:4002:c07::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id DC7891A1DA2 for ; Mon, 24 Aug 2015 21:20:56 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=xTxrfW+f; dkim-atps=neutral Received: by ykll84 with SMTP id l84so130759520ykl.0 for ; Mon, 24 Aug 2015 04:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A3mjYzd3yrG7on8sUIl9Z8rvle7IfDT/RWwlvafOvFQ=; b=xTxrfW+fX4BJnDj6pAPgwF6mL47zi9205aNApgob/ovjwScowcaMnGuZTemPYTGQBo ZTnvHXUQZNuYsyvUKqBJuUD3Tz7pbP1mLGYmRmm/VdEb4Z+a95D94wf+dwd5+UQV43z1 mv5X7zOtWIV4fjQl2yGpny/uT9MAswbkJ9pNkzv58sSM3U2n+T27zzrZPG8OG9607ccn jaiDrx62Y6PII0Qqs0IBf/mabcZE34a8lquRqcy351dY4kPII8egx/PnJ3YAG9OGl6gU pNrsSh4WpCAaB04oAwc6pPw8Xz2K1dx5MCPx7TmlZEkpWq1CmR63XFlfbs8IvLCo7tZl OKcA== X-Received: by 10.129.45.194 with SMTP id t185mr29233195ywt.52.1440415254901; Mon, 24 Aug 2015 04:20:54 -0700 (PDT) Received: from pek-khao-d1.corp.ad.wrs.com (unknown-178-22.windriver.com. [147.11.178.22]) by smtp.gmail.com with ESMTPSA id i82sm9014125ywg.1.2015.08.24.04.20.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Aug 2015 04:20:54 -0700 (PDT) From: Kevin Hao To: Michael Ellerman Subject: [PATCH v2 3/6] powerpc: kill mfvtb() Date: Mon, 24 Aug 2015 19:20:25 +0800 Message-Id: <1440415228-8006-4-git-send-email-haokexin@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1440415228-8006-1-git-send-email-haokexin@gmail.com> References: <1440415228-8006-1-git-send-email-haokexin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Zijlstra , linuxppc-dev@lists.ozlabs.org, Ingo Molnar , linux-kernel@vger.kernel.org MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This function is only used by get_vtb(). They are almost the same except the reading from the real register. Move the mfspr() to get_vtb() and kill the function mfvtb(). With this, we can eliminate the use of cpu_has_feature() in very core header file like reg.h. This is a preparation for the use of jump label for cpu_has_feature(). Signed-off-by: Kevin Hao --- v2: No change. arch/powerpc/include/asm/reg.h | 9 --------- arch/powerpc/include/asm/time.h | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index aa1cc5f015ee..d0b5f4b63776 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -1207,15 +1207,6 @@ : "r" ((unsigned long)(v)) \ : "memory") -static inline unsigned long mfvtb (void) -{ -#ifdef CONFIG_PPC_BOOK3S_64 - if (cpu_has_feature(CPU_FTR_ARCH_207S)) - return mfspr(SPRN_VTB); -#endif - return 0; -} - #ifdef __powerpc64__ #if defined(CONFIG_PPC_CELL) || defined(CONFIG_PPC_FSL_BOOK3E) #define mftb() ({unsigned long rval; \ diff --git a/arch/powerpc/include/asm/time.h b/arch/powerpc/include/asm/time.h index 10fc784a2ad4..6f69828458fb 100644 --- a/arch/powerpc/include/asm/time.h +++ b/arch/powerpc/include/asm/time.h @@ -106,7 +106,7 @@ static inline u64 get_vtb(void) { #ifdef CONFIG_PPC_BOOK3S_64 if (cpu_has_feature(CPU_FTR_ARCH_207S)) - return mfvtb(); + return mfspr(SPRN_VTB); #endif return 0; }