Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp168616pxj; Thu, 20 May 2021 06:55:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCIpL66alR8YN+3GhhCDf+5nl//aWe3wf8Mc/n6+q3YlIpFfcnoV4VnU1Y7MFxT0EHqhws X-Received: by 2002:a05:6402:176b:: with SMTP id da11mr3795762edb.234.1621518923637; Thu, 20 May 2021 06:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621518923; cv=none; d=google.com; s=arc-20160816; b=0ViqaHD+PCA/jYz3cQPqbfEMKMC/NHUNPfxHetYGy+9prfPiPApvVWUSt1S3c8eEhr MGwmabCyQxMRxuJ8G4cit6Ezm8/kI+aZ7DsBmqKvW8Pz4r13UU587OTTiHyMM8iq63j2 /+ZVf6Gyt24uZ7y9OWcx5CAGggASmqSa5WUl2VPiFxJAEj07POvAtIQOmzO8+EIR2EnA f88NeU+++r2h5ytFf6lpEzZI4Y7bgbvC0P4PH70K4INwvryCU10/XzlCd8YO3fQ0N4l2 dL8/yWKOwtTfsvNEugv/Op9LAdfJZqyaghe/1Sc/Np8rKE5kCF1zS7I2qM+9bL0Uhb3L u2hQ== 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=GVKXfGLLRLrEDM183cOHnBTGJZhErx8JyXzsiMwQ0Kg=; b=dkiuJUX54OueSc7eQDAEkmi8Lt0bigTAPum4PZwAAtMEgmbihszdHDFfyqAP34ilSg D58YR+T4Tik24ibU3gLVcllSa4D+jT8jvb+BseTfqbf84sRB+17SHFFl6F8u5lTRQM+h f6IZeIb8V+M3zTNC7FrV7iC9GtsOaZLdmwsbml0Rc940SapHq/8Wn+4ROW5iZ2F83kQa XO/p25cpOEUWo17QR82wukt+wTB0fd8RUOywPNtqpv6LPVha19Po1OycAXqW8lHLyQv0 l/FyDSqrDJtWBqA4Uh45ViCAD/mwmvaEJjV2NJdWFbPXggDxu5EoPWM0OCtdEsyzHDsT ypqQ== 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 v3si2581887ejb.173.2021.05.20.06.54.49; Thu, 20 May 2021 06:55:23 -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 S242990AbhETNxf (ORCPT + 99 others); Thu, 20 May 2021 09:53:35 -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 S235053AbhETNxV (ORCPT ); Thu, 20 May 2021 09:53:21 -0400 Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4FmB372KN3z9sW7; Thu, 20 May 2021 15:50:59 +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 F-56nO9M-OXf; Thu, 20 May 2021 15:50:59 +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 4FmB2w73WGz9sTp; Thu, 20 May 2021 15:50:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E13F78B815; Thu, 20 May 2021 15:50:48 +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 UtQ2-JkR5yOo; Thu, 20 May 2021 15:50:48 +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 8AC338B767; Thu, 20 May 2021 15:50:48 +0200 (CEST) Received: by po15610vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 7D92564C40; Thu, 20 May 2021 13:50:48 +0000 (UTC) Message-Id: <8ebbd977ea8cf8d706d82458f2a21acd44562a99.1621516826.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v2 11/12] powerpc/optprobes: Compact code source a bit. 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:48 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that lines can be up to 100 chars long, minimise the amount of split lines to increase readability. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/optprobes.c | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kernel/optprobes.c index 8c08ca15faf3..9c1c8de8c06d 100644 --- a/arch/powerpc/kernel/optprobes.c +++ b/arch/powerpc/kernel/optprobes.c @@ -18,18 +18,12 @@ #include #include -#define TMPL_CALL_HDLR_IDX \ - (optprobe_template_call_handler - optprobe_template_entry) -#define TMPL_EMULATE_IDX \ - (optprobe_template_call_emulate - optprobe_template_entry) -#define TMPL_RET_IDX \ - (optprobe_template_ret - optprobe_template_entry) -#define TMPL_OP_IDX \ - (optprobe_template_op_address - optprobe_template_entry) -#define TMPL_INSN_IDX \ - (optprobe_template_insn - optprobe_template_entry) -#define TMPL_END_IDX \ - (optprobe_template_end - optprobe_template_entry) +#define TMPL_CALL_HDLR_IDX (optprobe_template_call_handler - optprobe_template_entry) +#define TMPL_EMULATE_IDX (optprobe_template_call_emulate - optprobe_template_entry) +#define TMPL_RET_IDX (optprobe_template_ret - optprobe_template_entry) +#define TMPL_OP_IDX (optprobe_template_op_address - optprobe_template_entry) +#define TMPL_INSN_IDX (optprobe_template_insn - optprobe_template_entry) +#define TMPL_END_IDX (optprobe_template_end - optprobe_template_entry) DEFINE_INSN_CACHE_OPS(ppc_optinsn); @@ -280,8 +274,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *p) */ patch_branch(buff + TMPL_RET_IDX, nip, 0); - flush_icache_range((unsigned long)buff, - (unsigned long)(&buff[TMPL_END_IDX])); + flush_icache_range((unsigned long)buff, (unsigned long)(&buff[TMPL_END_IDX])); op->optinsn.insn = buff; @@ -319,10 +312,8 @@ void arch_optimize_kprobes(struct list_head *oplist) * Backup instructions which will be replaced * by jump address */ - memcpy(op->optinsn.copied_insn, op->kp.addr, - RELATIVEJUMP_SIZE); - create_branch(&instr, op->kp.addr, - (unsigned long)op->optinsn.insn, 0); + memcpy(op->optinsn.copied_insn, op->kp.addr, RELATIVEJUMP_SIZE); + create_branch(&instr, op->kp.addr, (unsigned long)op->optinsn.insn, 0); patch_instruction(op->kp.addr, instr); list_del_init(&op->list); } @@ -333,8 +324,7 @@ void arch_unoptimize_kprobe(struct optimized_kprobe *op) arch_arm_kprobe(&op->kp); } -void arch_unoptimize_kprobes(struct list_head *oplist, - struct list_head *done_list) +void arch_unoptimize_kprobes(struct list_head *oplist, struct list_head *done_list) { struct optimized_kprobe *op; struct optimized_kprobe *tmp; @@ -345,8 +335,7 @@ void arch_unoptimize_kprobes(struct list_head *oplist, } } -int arch_within_optimized_kprobe(struct optimized_kprobe *op, - unsigned long addr) +int arch_within_optimized_kprobe(struct optimized_kprobe *op, unsigned long addr) { return ((unsigned long)op->kp.addr <= addr && (unsigned long)op->kp.addr + RELATIVEJUMP_SIZE > addr); -- 2.25.0