From patchwork Thu Feb 19 12:08:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kepplinger-Novakovic X-Patchwork-Id: 5851341 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 D95979F373 for ; Thu, 19 Feb 2015 12:11:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0CDD520272 for ; Thu, 19 Feb 2015 12:11:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B874F202B8 for ; Thu, 19 Feb 2015 12:11:18 +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 1YOPuy-0006ck-R3; Thu, 19 Feb 2015 12:09:20 +0000 Received: from mx02.posteo.de ([89.146.194.165]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YOPuv-0006TI-MZ for linux-arm-kernel@lists.infradead.org; Thu, 19 Feb 2015 12:09:18 +0000 Received: from dovecot03.posteo.de (unknown [185.67.36.28]) by mx02.posteo.de (Postfix) with ESMTPS id 956B725A211A; Thu, 19 Feb 2015 13:08:46 +0100 (CET) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot03.posteo.de (Postfix) with ESMTPSA id 3knvpQ2jzhz5vNG; Thu, 19 Feb 2015 13:08:46 +0100 (CET) From: Martin Kepplinger To: shawn.guo@linaro.org, kernel@pengutronix.de, linux@arm.linux.org.uk Subject: [PATCH] arch: arm [mach-imx] use sign_extend32() for sign_extension Date: Thu, 19 Feb 2015 13:08:09 +0100 Message-Id: <1424347689-2636-2-git-send-email-martink@posteo.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1424347689-2636-1-git-send-email-martink@posteo.de> References: <1424347689-2636-1-git-send-email-martink@posteo.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150219_040917_949533_51EE9EA7 X-CRM114-Status: UNSURE ( 9.96 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: Martin Kepplinger , Martin Kepplinger , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Martin Kepplinger Signed-off-by: Martin Kepplinger --- arch/arm/mach-imx/clk-pllv2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-imx/clk-pllv2.c b/arch/arm/mach-imx/clk-pllv2.c index 20889d5..1bbd08c 100644 --- a/arch/arm/mach-imx/clk-pllv2.c +++ b/arch/arm/mach-imx/clk-pllv2.c @@ -5,6 +5,7 @@ #include #include #include +#include #include @@ -88,11 +89,10 @@ static unsigned long __clk_pllv2_recalc_rate(unsigned long parent_rate, mfi = (mfi <= 5) ? 5 : mfi; mfd = dp_mfd & MXC_PLL_DP_MFD_MASK; mfn = mfn_abs = dp_mfn & MXC_PLL_DP_MFN_MASK; - /* Sign extend to 32-bits */ - if (mfn >= 0x04000000) { - mfn |= 0xFC000000; + + mfn = sign_extend32(mfn, 26); + if (mfn < 0) mfn_abs = -mfn; - } ref_clk = 2 * parent_rate; if (dbl != 0)