From patchwork Wed Aug 26 01:24:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yalin wang X-Patchwork-Id: 7073791 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6AE649F305 for ; Wed, 26 Aug 2015 01:27:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86AEB20612 for ; Wed, 26 Aug 2015 01:27:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6193920600 for ; Wed, 26 Aug 2015 01:27:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZUPSh-0002lG-Vo; Wed, 26 Aug 2015 01:25:11 +0000 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZUPSe-0001c1-P5 for linux-arm-kernel@lists.infradead.org; Wed, 26 Aug 2015 01:25:10 +0000 Received: by pabzx8 with SMTP id zx8so51118420pab.1 for ; Tue, 25 Aug 2015 18:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=UjhWWE5mFL/rQvJTv+DyO0ri/YgXIirfcQU3ARqihC0=; b=yZw5GaO8++Da0629suA30EEYOtf6353xxbrD20h41kiWaWHd8x/wzYlkOM8BNaLVX/ sQHXAU6f0GwIbMwqotp9gmuDy+TK7KxzWFjP4WTc0BXxoPign9pcWtVmZohBpI0hIJfE 1fX2/mCB09TkCPW2WikzL7OEt/ZWhSNoo3q5RJBpH1dR/6PLWwUnu0FEa2Jgzrvw45MQ pEEN/aLpiJDbwP+pEWCCPd2WzbSSatq9oLuGAEG7rb3oTFlFuYMZRuA7awunwbFi+xmO fcn2vK2hPeSg/57DYk+CoIUeYAgUBWQ8tMhnhpkVBvf6GDtotShwLUOsIj8IpkfZqx8r fv/g== X-Received: by 10.68.195.74 with SMTP id ic10mr61929503pbc.68.1440552288021; Tue, 25 Aug 2015 18:24:48 -0700 (PDT) Received: from ubuntu.localdomain ([17.87.20.100]) by smtp.googlemail.com with ESMTPSA id qf7sm22490464pbc.18.2015.08.25.18.24.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Aug 2015 18:24:47 -0700 (PDT) From: yalin wang To: linux@arm.linux.org.uk, yalin.wang2010@gmail.com, wangnan0@huawei.com, nico@linaro.org, masami.hiramatsu.pt@hitachi.com, keescook@chromium.org, rabin@rab.in, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, will.deacon@arm.com Subject: [PATCH] arm: insn: use set_fixmap_offset to make it more clear Date: Wed, 26 Aug 2015 09:24:26 +0800 Message-Id: <1440552266-19940-1-git-send-email-yalin.wang2010@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150825_182508_855668_4FE48A6F X-CRM114-Status: UNSURE ( 9.87 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A little change to patch_map() function, use set_fixmap_offset() to make code more clear. Signed-off-by: yalin wang --- arch/arm/kernel/patch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm/kernel/patch.c b/arch/arm/kernel/patch.c index 69bda1a..5779105 100644 --- a/arch/arm/kernel/patch.c +++ b/arch/arm/kernel/patch.c @@ -36,9 +36,8 @@ static void __kprobes *patch_map(void *addr, int fixmap, unsigned long *flags) else __acquire(&patch_lock); - set_fixmap(fixmap, page_to_phys(page)); - - return (void *) (__fix_to_virt(fixmap) + (uintaddr & ~PAGE_MASK)); + return (void *)set_fixmap_offset(fixmap, page_to_phys(page) + + (uintaddr & ~PAGE_MASK)); } static void __kprobes patch_unmap(int fixmap, unsigned long *flags)