Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1135909pxj; Fri, 21 May 2021 07:17:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxisfGXa4YshG3GRAqYD5WapbfU+B/OfQ+KqGZmT7Ar+N5JUuAp3+0u7ACdrDGBVXqkvlPm X-Received: by 2002:a05:6402:1d2c:: with SMTP id dh12mr8101565edb.237.1621606637366; Fri, 21 May 2021 07:17:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621606637; cv=none; d=google.com; s=arc-20160816; b=mcnGQVJ8sA5XwO1oYW8o+IgUlSYqBgbL/4NOdOVwrPXHRCvLVt9mVWJutlz6vLoQDT PAvZYhmRFUUAApazAdKE1WZlQKQpgp1mOG6wYe1Qqq7EPOmooul4I9PThAWobDn9VQj+ X0LoBkcJv5uiLizJ8Gq757vdU0SPGd/rQeEo+2jRRBV/8J7+9rxJy4m9Ls1pgmfY4ZQX daFSi4bOxlV0k+Hc9DO4Bwe8kl0+6rs6trjDsqH8SJyLQod/8e9idxVgA50fasP3xtwC qvQ0N3YeDuTM7xQ7r5zO+2hyzvaXvTWIg62L2/Pxt//Ysh4pCioELYXnh6Z/qGX/zRl5 JRAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:references:in-reply-to :message-id; bh=nLoXoL04kmNVE3QoodjV7rMQKb7rhgirEJogCmDKtCU=; b=VT70cUqaqjyQPhEUBva0SdtRdpo59Uv2SeoVCXr/k2zsUW6oXzliFrIeKnrz7C/yBo QnWle+CVEV0BKj0t2NOJCmN/vgbiTlYE9X3GEb35r27ehRuI4naf+pbXRlR00HuyUcIx WZ7MXsQAVG0h5TwLaqZ25eD/RerGn5CCfF9d0win8ljHIMUiAzwAu0XPLuTT3pIKGQYK c3alydB8F95uNEX6r6hktbnN27ATEeaRrtt5L8E37k6WZmWHDX8XtT/+l9AFJjcgvUnf VGlOvLFiA12dkjCBpBbHJVLY3SvA3grgaMXUDwP6yL/VolSZFE1ZSfNIsgRkriOzLxgp 7zTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k12si5065614ejg.542.2021.05.21.07.16.53; Fri, 21 May 2021 07:17:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242595AbhETNwg (ORCPT + 99 others); Thu, 20 May 2021 09:52:36 -0400 Received: from pegase2.c-s.fr ([93.17.235.10]:46505 "EHLO pegase2.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241613AbhETNwX (ORCPT ); Thu, 20 May 2021 09:52:23 -0400 Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4FmB2z0sFzz9sV2; Thu, 20 May 2021 15:50:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sDVBm8-iu04O; Thu, 20 May 2021 15:50:51 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4FmB2q4d8cz9sTM; Thu, 20 May 2021 15:50:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 71AA88B817; Thu, 20 May 2021 15:50:43 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id k3dLpxm9xnWy; Thu, 20 May 2021 15:50:43 +0200 (CEST) Received: from po15610vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.230.105]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4E9648B813; Thu, 20 May 2021 15:50:43 +0200 (CEST) Received: by po15610vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 43D7564C40; Thu, 20 May 2021 13:50:43 +0000 (UTC) Message-Id: <5f6b9c8c83170ed310953eac2f5b14539bfc964a.1621516826.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v2 06/12] powerpc/lib/code-patching: Make instr_is_branch_to_addr() static To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , naveen.n.rao@linux.vnet.ibm.com, jniethe5@gmail.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 20 May 2021 13:50:43 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org instr_is_branch_to_addr() is only used in code-patching.c Make it static. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/code-patching.h | 1 - arch/powerpc/lib/code-patching.c | 18 +++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/include/asm/code-patching.h b/arch/powerpc/include/asm/code-patching.h index f1d029bf906e..f9bd1397b696 100644 --- a/arch/powerpc/include/asm/code-patching.h +++ b/arch/powerpc/include/asm/code-patching.h @@ -59,7 +59,6 @@ static inline int modify_instruction_site(s32 *site, unsigned int clr, unsigned int instr_is_relative_branch(struct ppc_inst instr); int instr_is_relative_link_branch(struct ppc_inst instr); -int instr_is_branch_to_addr(const struct ppc_inst *instr, unsigned long addr); unsigned long branch_target(const struct ppc_inst *instr); int translate_branch(struct ppc_inst *instr, const struct ppc_inst *dest, const struct ppc_inst *src); diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c index 0308429b0d1a..82f2c1edb498 100644 --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c @@ -367,15 +367,6 @@ unsigned long branch_target(const struct ppc_inst *instr) return 0; } -int instr_is_branch_to_addr(const struct ppc_inst *instr, unsigned long addr) -{ - if (instr_is_branch_iform(ppc_inst_read(instr)) || - instr_is_branch_bform(ppc_inst_read(instr))) - return branch_target(instr) == addr; - - return 0; -} - int translate_branch(struct ppc_inst *instr, const struct ppc_inst *dest, const struct ppc_inst *src) { @@ -410,6 +401,15 @@ void __patch_exception(int exc, unsigned long addr) #ifdef CONFIG_CODE_PATCHING_SELFTEST +static int instr_is_branch_to_addr(const struct ppc_inst *instr, unsigned long addr) +{ + if (instr_is_branch_iform(ppc_inst_read(instr)) || + instr_is_branch_bform(ppc_inst_read(instr))) + return branch_target(instr) == addr; + + return 0; +} + static void __init test_trampoline(void) { asm ("nop;\n"); -- 2.25.0