From patchwork Thu Aug 20 12:14:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hao X-Patchwork-Id: 509034 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B666B14028E for ; Thu, 20 Aug 2015 22:24:44 +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=XSY3BpT8; 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 8A17B1A2C28 for ; Thu, 20 Aug 2015 22:24:44 +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=XSY3BpT8; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-yk0-x22b.google.com (mail-yk0-x22b.google.com [IPv6:2607:f8b0:4002:c07::22b]) (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 19FF51A1D7A for ; Thu, 20 Aug 2015 22:15:12 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=XSY3BpT8; dkim-atps=neutral Received: by ykll84 with SMTP id l84so35027143ykl.0 for ; Thu, 20 Aug 2015 05:15:09 -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=DT8yCI5uYjkUmbS+6/FQ00VygikmszNcK+CVwZlC0FM=; b=XSY3BpT81P+QnLbCVxKoYdxbyLbnz2bDe4RZQvHlgxVUpYIgL5rE6udWD4jo4K8CsD eeD9W8zwr0oMauRs6Z3yL90oIIwSVwlrEjxFoQYt+IqS+0NJRvZe6DFtnWLzufZsxDBg Is0lI6FxVn+XsOY/40bld7wbdURZZydiWMxOAOWHuUyab/si27juxZTvlZYr9wSa4CdE zOUwA9u2xDKKC/SSKuVN8bjQqz7gKuGA24XQgki54US2nvcw14JqNZkYzGXrQoqVqkQT qyEWI+f/Aay//pPeCeZ8VbeXtYFAzI+oWGDu9xsd3p9UwFy32YbH4T5zsjqvsKNvCiIg uGag== X-Received: by 10.170.48.10 with SMTP id 10mr2812003ykq.92.1440072909850; Thu, 20 Aug 2015 05:15:09 -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 w62sm3745368ywe.50.2015.08.20.05.15.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Aug 2015 05:15:09 -0700 (PDT) From: Kevin Hao To: Michael Ellerman Subject: [PATCH 5/8] powerpc: kill mfvtb() Date: Thu, 20 Aug 2015 20:14:33 +0800 Message-Id: <1440072876-8321-6-git-send-email-haokexin@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1440072876-8321-1-git-send-email-haokexin@gmail.com> References: <1440072876-8321-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: linuxppc-dev@lists.ozlabs.org, 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 --- 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; }