From: Martin Kepplinger <martink@posteo.de>
To: shawn.guo@linaro.org, kernel@pengutronix.de, linux@arm.linux.org.uk
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Martin Kepplinger <martin.kepplinger@theobroma-systems.com>,
Martin Kepplinger <martink@posteo.de>
Subject: [PATCH] arch: arm [mach-imx] use sign_extend32() for sign_extension
Date: Thu, 19 Feb 2015 13:08:09 +0100 [thread overview]
Message-ID: <1424347689-2636-2-git-send-email-martink@posteo.de> (raw)
In-Reply-To: <1424347689-2636-1-git-send-email-martink@posteo.de>
From: Martin Kepplinger <martin.kepplinger@theobroma-systems.com>
Signed-off-by: Martin Kepplinger <martink@posteo.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
prev parent reply other threads:[~2015-02-19 12:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-19 12:08 [RFC][PATCH] " Martin Kepplinger
2015-02-19 12:08 ` Martin Kepplinger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1424347689-2636-2-git-send-email-martink@posteo.de \
--to=martink@posteo.de \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=martin.kepplinger@theobroma-systems.com \
--cc=shawn.guo@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®