lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 19 Feb 2015 13:08:09 +0100
From:	Martin Kepplinger <martink@...teo.de>
To:	shawn.guo@...aro.org, kernel@...gutronix.de, linux@....linux.org.uk
Cc:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	Martin Kepplinger <martin.kepplinger@...obroma-systems.com>,
	Martin Kepplinger <martink@...teo.de>
Subject: [PATCH] arch: arm [mach-imx] use sign_extend32() for sign_extension

From: Martin Kepplinger <martin.kepplinger@...obroma-systems.com>

Signed-off-by: Martin Kepplinger <martink@...teo.de>
---
 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 <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/err.h>
+#include <linux/bitops.h>
 
 #include <asm/div64.h>
 
@@ -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)
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ