Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3311500pxj; Mon, 14 Jun 2021 20:46:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyD2KM7AlmfcSyLTX6rloplnFAxrODaUE8I9qk33bLXJ8uTtawjV9yE/onw2pyZrNdvPNu0 X-Received: by 2002:a05:6402:1d06:: with SMTP id dg6mr20135848edb.132.1623728796113; Mon, 14 Jun 2021 20:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623728796; cv=none; d=google.com; s=arc-20160816; b=oQihyJVnp+95uktvOCNIcmytcBYBod0pS6zLizSpyzbxA+08reHhj3j7xPowiqktBW b/eceDtT1R48z1vnqRKs3C3bzsPGFWmmMz+/yTyuI2rFlSSo4CqbNGSIIXXyUQDe+i1b Rzx2FHpfO9zKRc5VeNBjnsRwL1Fcj/bqIAWZkSji/XDWvQb0JEsTIMXdYQbg1+DYRCxL b6ilEyQS2SacgQzaoJJUkn1kjfPz8fmR0xbo0EblvniER5ubMNSYYVDotDjzUghc48Sq raQUsaB/Xr43N0DItnGhXjqdnj/wrjx36GEiTA8Ee1oHmae2eSTuiKpEo/J7HEDYDhzU KNIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=hSm4lDQmvuYcNCJIDeoEyVLYEDl2O+na4iPfgEBo8es=; b=zF67YOSxXI9ToUCoO16UsMUMA81PLfTt8RTbC6+tvXuqOmSK7StUG8ZdZptWO/SBai pROiAGRSJutTyvVelJXIRj0DqOtV0vSF3zhwAfrLa/CmYyaNNFzRoMASiDLHh4irouFT d/6NYKM7An24PAkY4Qgn74yjaW0I9jSFMJh1sSCJ6cwhePTL4g+xd26J0qQqs+11wU7P HZef1mSYwCefWkEfIxkiCbe72FQ3EzRJLX5wCLqi2zvTfIFwvjELwFf4kQhh7Inr/ilY m+L5atBrP/YmGaGLCuSRo8kkEv4ZUYF65Ntcnu3p+6UD4h0c+fridh/ApdGTctq3uJq5 7Oyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b8g4K1XK; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h93si14779808edd.584.2021.06.14.20.46.13; Mon, 14 Jun 2021 20:46:36 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b8g4K1XK; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230452AbhFODoW (ORCPT + 99 others); Mon, 14 Jun 2021 23:44:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbhFODoV (ORCPT ); Mon, 14 Jun 2021 23:44:21 -0400 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4B88C061574 for ; Mon, 14 Jun 2021 20:42:15 -0700 (PDT) Received: by mail-yb1-xb29.google.com with SMTP id i4so18516685ybe.2 for ; Mon, 14 Jun 2021 20:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hSm4lDQmvuYcNCJIDeoEyVLYEDl2O+na4iPfgEBo8es=; b=b8g4K1XKnGa0I4a6RVUeAajfdq3ihZvzQ2SFupYVUvkuetR6V7C/ZsVH3wtc3n6GNS UAdJ8hO/Dy2tB4L77mF7tvHUV/nJDLI38kqk+bfYwMtAhwR0uEf9FI2E4adb5WeLpWoF oeXcvhfIXyuCgTgcJA7YyHoEDfaDrROGxTitG23AflJ/JjcbBh3y1wxPXFvKVX9/luxD /tG3zci1NYk23GcE1IvM/hZqQv/llEKN4fo+0iQO5Ia7qTdLTjO4XWOuW5Q3nBF/YErc +BUZBYAWZY3uQxo2PM7sxDSvuChRPzpW6/Mmol9HB/2wEfEquYaY4Pp6xc4IkeWMejA8 xGZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hSm4lDQmvuYcNCJIDeoEyVLYEDl2O+na4iPfgEBo8es=; b=OAOj/b7NN7LNnTQ7PHLg74TJgXaXQa3RE5d1lI4NVEDCXruCCec/N4lyvRsP5/YdMr IxZfL8eNpVc8HoY+8s+HuUl80zOIvgy+oV7dZdXMJsYHreJu0CR2G6Ur+S9Uljj9Ttxp 8hI5Irrx+N9Wf7fo1i4u+196ypP99mM4FCi+wQ9Tz6ZDUB9F9JRlAB/NNvNUsTUtjSTz m6IzwO8af2JOrWY2GMT2gyUdAK8WE/zPhoL6UHjPD5sRM3/IAkFs+gjR8WLRtK85rlxn KbHYRxzW5fbfL6EiuQGhPzvDOnLChIMjTserujfBB13XjJJZ8biInvFe3mDP0xQhD9RY JOKQ== X-Gm-Message-State: AOAM532Kg+tVoQNUkftHjkzNuvqsVMeKeGe8Vj6u9SKMSD8udmb/EC38 ygsYDLa9yNDNat7xyFl9yOJtfNKukBQS94yu9x8= X-Received: by 2002:a25:69ce:: with SMTP id e197mr27366126ybc.265.1623728534967; Mon, 14 Jun 2021 20:42:14 -0700 (PDT) MIME-Version: 1.0 References: <5f6b9c8c83170ed310953eac2f5b14539bfc964a.1621516826.git.christophe.leroy@csgroup.eu> In-Reply-To: <5f6b9c8c83170ed310953eac2f5b14539bfc964a.1621516826.git.christophe.leroy@csgroup.eu> From: Jordan Niethe Date: Tue, 15 Jun 2021 13:42:03 +1000 Message-ID: Subject: Re: [PATCH v2 06/12] powerpc/lib/code-patching: Make instr_is_branch_to_addr() static To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , "Naveen N. Rao" , linux-kernel@vger.kernel.org, linuxppc-dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 20, 2021 at 11:50 PM Christophe Leroy wrote: > > 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 > Reviewed by: Jordan Niethe