From patchwork Mon Dec 28 07:07:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yalin wang X-Patchwork-Id: 7924741 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BD066BEEE5 for ; Mon, 28 Dec 2015 07:10:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E1B57201EF for ; Mon, 28 Dec 2015 07:10:05 +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 1E46B201B4 for ; Mon, 28 Dec 2015 07:10:05 +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 1aDRut-0007Xv-Lm; Mon, 28 Dec 2015 07:08:27 +0000 Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aDRup-0007WZ-S4 for linux-arm-kernel@lists.infradead.org; Mon, 28 Dec 2015 07:08:24 +0000 Received: by mail-pf0-x22f.google.com with SMTP id q63so73095369pfb.0 for ; Sun, 27 Dec 2015 23:08:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=hmsKiL4MnuAeFbHenZ7q96spgcDUWZLnR84f7iBBy4Q=; b=DIiYr9i5/7SQesi63I/5ulo3h9SBHeXQjokgCRqoZxcHKjABmYun+iibmRNe9T7HMp azgD0Vei5GbM4CEFYlqLzPyQYJFEo6qDELeK7LkWBLHHSG9X/b7OnWdCJN9x4bTkdi4L WUN0Jm0n/4V8mvTvc+fGjkH9h6ZohkMCPVSSrpwnTR1+Okfe3x55VgUScjrZxBsZ4NYb 2lchTY7wM4Z6pYtSta6ugsVddzYfSuFNhAMHbj+lmFcByuTz/fOXnD8vVfnMDXm+YOUk J0nznpc02EGFEWdqsNeq3vrCjEw3Nnte0eN7giV43RHAtlgxM0t1yZpWoxUooJNU0cO2 pFfg== X-Received: by 10.98.69.73 with SMTP id s70mr76624523pfa.4.1451286481996; Sun, 27 Dec 2015 23:08:01 -0800 (PST) Received: from ubuntu.localdomain ([17.87.20.218]) by smtp.googlemail.com with ESMTPSA id 27sm24331686pfh.4.2015.12.27.23.07.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 27 Dec 2015 23:08:01 -0800 (PST) From: yalin wang To: linux@arm.linux.org.uk, tixy@linaro.org, wangnan0@huawei.com, masami.hiramatsu.pt@hitachi.com, yalin.wang2010@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFC] arm: change to use generic sign_extend32() function Date: Mon, 28 Dec 2015 15:07:35 +0800 Message-Id: <1451286455-13121-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-20151227_230823_978176_5B27F87D X-CRM114-Status: UNSURE ( 8.66 ) 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=-4.1 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 change to use generic sign_extend32() to caaculate branch_displacement. Signed-off-by: yalin wang --- arch/arm/probes/decode-arm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm/probes/decode-arm.c b/arch/arm/probes/decode-arm.c index f72c33a..ff794c0 100644 --- a/arch/arm/probes/decode-arm.c +++ b/arch/arm/probes/decode-arm.c @@ -20,13 +20,12 @@ #include #include #include +#include #include "decode.h" #include "decode-arm.h" -#define sign_extend(x, signbit) ((x) | (0 - ((x) & (1 << (signbit))))) - -#define branch_displacement(insn) sign_extend(((insn) & 0xffffff) << 2, 25) +#define branch_displacement(insn) sign_extend32(((insn) & 0xffffff) << 2, 25) /* * To avoid the complications of mimicing single-stepping on a