Received: by 10.192.165.148 with SMTP id m20csp632195imm; Wed, 9 May 2018 20:19:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpkLZVtE2mSUZzE2V7dVLLypDtlPzMTUYS7YpLpVmmQRfLiNIqq8Tspa4s9aCbWtzYdNZaT X-Received: by 2002:a65:414d:: with SMTP id x13-v6mr38477128pgp.223.1525922345912; Wed, 09 May 2018 20:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525922345; cv=none; d=google.com; s=arc-20160816; b=FI+Sv1yNy+s3fjqpfolzoLAX73V0YfNZdqRT5ObE4ev1+PnRtVUb4s+n+wAhOmweqm SWjyKYua2bUqi1MQusdmc/wgv8BDI0LzhP8CQVVgIKwLVlvSgs/ci0OFypB4X+heOoHq XFWwRk9jfmLbCUJNN/2wwHr+3Q3yb+I+W9c+jxlnDQxXE3e8EX/ebRN0kSyoEigc1Xy0 T3LKaaRuiqA+9KIUNUdFv6p8pCHSHj6d6qxpR3oCU6nDMMyQ8kjmTpqlXCZuRa2/cuff YZXP0ehRU6r5cGWOtkkmqhxgxcCmxj55fRr0zY45u6NLNtio8MjpBppdXXiT/RIIhN4S yszg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=g6AbDRTj0beRNNdYsWLwtkOv8XzoGfMN6284EfXjh8o=; b=wPyKc2jz4Kj7iOcAGLIn+ywR+IfepHHQwZ8IxtS28HAGrsoHSj19t5H45nr3RCVjZs b0ohahOQKpLHULOnE5lqF0WdisTTPSCLbpkB6IyHH/HJ06Y4WnHHwDyyhL9+N4lxuiIh ZyV8EUTwfoi8mm4arr2JyM8uhaj2k5CJiWGhTHw9+eXPPwQkF8upxGpgXHt1QKyL1/S1 /yPH/QxcP0uw8RaaXcOYItJQ/FWNQ0OvM0G8Y02qgJTyoFD2r/ywpWKLnF5baa8FqRfm EYACX2/2UVGOlffeIcWXpsCYW3aKGZS5Xsdu1CjHalY+GSinFhFK4eZlHygoCgMlGrPN lJug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aEhZf7ZX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id s12-v6si4166960pgn.194.2018.05.09.20.18.21; Wed, 09 May 2018 20:19:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aEhZf7ZX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1756566AbeEJDSL (ORCPT + 99 others); Wed, 9 May 2018 23:18:11 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:34000 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756373AbeEJDSK (ORCPT ); Wed, 9 May 2018 23:18:10 -0400 Received: by mail-pl0-f67.google.com with SMTP id ay10-v6so454644plb.1 for ; Wed, 09 May 2018 20:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=g6AbDRTj0beRNNdYsWLwtkOv8XzoGfMN6284EfXjh8o=; b=aEhZf7ZXuyA+Z4uUsd145w81pPrNilrBMzr55cj+AekHII5OZpgfOowxbjSwFwM0Sc 4qKGojun258JPWYhSvZrwWb/vgw4ztjUMUMjKsm5Zspx6MM0iDGJIBtqAtNUN855aow4 eqhQiBzw7dVwoVpJfm2QaRXxmJViMoppFTgk/AW7qc4HGDKPD3BiCc08ZUfC+sPXeJhG V6tfvOONnMdkwG54gNTB32wRoz0ZD/E6zPJK6n2VYSkcrtzKxUh2UXlugdpI5GBzFIPq kNvAuxz54ObZAuufcL5htmqlqB31DPpCegWft6D6ghh7Hzm/GyTKkrfHPzTo8sXhI4U8 jr/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:mime-version:content-disposition:user-agent; bh=g6AbDRTj0beRNNdYsWLwtkOv8XzoGfMN6284EfXjh8o=; b=JNPoH0kmnPs6eZRXRduVtsF8liJ4kbZlc45vqqKyxq28T0zBOKgXIi3BPHAaVyQi1E K+p7POKnTmZXZsqgLzjzh5QtBX9NgqPWhkJg00GFHQRzaYPmoJdMbRwB0/xveetXNPZ0 Qhd1Ozdol7E+PK7PPGk86vIF49bmCe1sQMj/5kstkVa7a7BUtXrqUVj7LawJP2gcT2Xt kvE9tBvALNONqnvIhGs9TzdI/j911jS4UMzvwDgDVbBpDgf3NpF0n16iWB8mnKzc8PZ1 mOLS5/Njp4qOrd1KRKp21p7JguQdsBloVdMC+VW4OFx3zWDfxA7hKb3Wsw89T2Fky68V O07g== X-Gm-Message-State: ALQs6tDgpQCrg3VquPQ2IXSExFpFvURRclDncQ5PaG12jMvh8HXOzfiX eDOJiQs/uqZpDES6AXWkp2U= X-Received: by 2002:a17:902:ab8d:: with SMTP id f13-v6mr47371480plr.81.1525922289922; Wed, 09 May 2018 20:18:09 -0700 (PDT) Received: from udknight.localhost ([183.90.36.235]) by smtp.gmail.com with ESMTPSA id a77sm24131002pfe.70.2018.05.09.20.16.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 May 2018 20:18:09 -0700 (PDT) Received: from udknight.localhost (localhost [127.0.0.1]) by udknight.localhost (8.14.9/8.14.9) with ESMTP id w4A3GBaW026066; Thu, 10 May 2018 11:16:11 +0800 Received: (from root@localhost) by udknight.localhost (8.14.9/8.14.9/Submit) id w4A3EJs3026036; Thu, 10 May 2018 11:14:19 +0800 Date: Thu, 10 May 2018 11:14:19 +0800 From: Wang YanQing To: daniel@iogearbox.net Cc: linux@armlinux.org.uk, ast@fb.com, illusionist.neo@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] bpf, arm32: Fix inconsistent naming about emit_a32_lsr_r64|emit_a32_lsr_i64 Message-ID: <20180510031419.GA26016@udknight> Mail-Followup-To: Wang YanQing , daniel@iogearbox.net, linux@armlinux.org.uk, ast@fb.com, illusionist.neo@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The reasonable names for emit_a32_lsr_r64|emit_a32_lsr_i64 are emit_a32_rsh_r64|emit_a32_rsh_i64. This patch also correct a wrong comment. Signed-off-by: Wang YanQing --- arch/arm/net/bpf_jit_32.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 82689b9..c0b4124 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c @@ -708,7 +708,7 @@ static inline void emit_a32_arsh_r64(const u8 dst[], const u8 src[], bool dstk, } /* dst = dst >> src */ -static inline void emit_a32_lsr_r64(const u8 dst[], const u8 src[], bool dstk, +static inline void emit_a32_rsh_r64(const u8 dst[], const u8 src[], bool dstk, bool sstk, struct jit_ctx *ctx) { const u8 *tmp = bpf2a32[TMP_REG_1]; const u8 *tmp2 = bpf2a32[TMP_REG_2]; @@ -724,7 +724,7 @@ static inline void emit_a32_lsr_r64(const u8 dst[], const u8 src[], bool dstk, emit(ARM_LDR_I(rm, ARM_SP, STACK_VAR(dst_hi)), ctx); } - /* Do LSH operation */ + /* Do RSH operation */ emit(ARM_RSB_I(ARM_IP, rt, 32), ctx); emit(ARM_SUBS_I(tmp2[0], rt, 32), ctx); emit(ARM_MOV_SR(ARM_LR, rd, SRTYPE_LSR, rt), ctx); @@ -774,7 +774,7 @@ static inline void emit_a32_lsh_i64(const u8 dst[], bool dstk, } /* dst = dst >> val */ -static inline void emit_a32_lsr_i64(const u8 dst[], bool dstk, +static inline void emit_a32_rsh_i64(const u8 dst[], bool dstk, const u32 val, struct jit_ctx *ctx) { const u8 *tmp = bpf2a32[TMP_REG_1]; const u8 *tmp2 = bpf2a32[TMP_REG_2]; @@ -1330,7 +1330,7 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx) case BPF_ALU64 | BPF_RSH | BPF_K: if (unlikely(imm > 63)) return -EINVAL; - emit_a32_lsr_i64(dst, dstk, imm, ctx); + emit_a32_rsh_i64(dst, dstk, imm, ctx); break; /* dst = dst << src */ case BPF_ALU64 | BPF_LSH | BPF_X: @@ -1338,7 +1338,7 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx) break; /* dst = dst >> src */ case BPF_ALU64 | BPF_RSH | BPF_X: - emit_a32_lsr_r64(dst, src, dstk, sstk, ctx); + emit_a32_rsh_r64(dst, src, dstk, sstk, ctx); break; /* dst = dst >> src (signed) */ case BPF_ALU64 | BPF_ARSH | BPF_X: -- 1.8.5.6.2.g3d8a54e.dirty