[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20140520183349.5284acfb2a3a5d4dbe93a4d2@skynet.be>
Date: Tue, 20 May 2014 18:33:49 +0200
From: Fabian Frederick <fabf@...net.be>
To: linux-kernel <linux-kernel@...r.kernel.org>
Cc: Mauro Carvalho Chehab <m.chehab@...sung.com>,
akpm <akpm@...ux-foundation.org>
Subject: [PATCH 1/1] drivers/media/dvb-frontends/dib8000.c: replace shift
loop by ilog2
Cc: Mauro Carvalho Chehab <m.chehab@...sung.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@...net.be>
---
drivers/media/dvb-frontends/dib8000.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/dvb-frontends/dib8000.c b/drivers/media/dvb-frontends/dib8000.c
index 1632d78..8625634 100644
--- a/drivers/media/dvb-frontends/dib8000.c
+++ b/drivers/media/dvb-frontends/dib8000.c
@@ -1922,14 +1922,12 @@ static const s32 lut_1000ln_mant[] =
s32 dib8000_get_adc_power(struct dvb_frontend *fe, u8 mode)
{
struct dib8000_state *state = fe->demodulator_priv;
- u32 ix = 0, tmp_val = 0, exp = 0, mant = 0;
+ u32 ix = 0, exp = 0, mant = 0;
s32 val;
val = dib8000_read32(state, 384);
if (mode) {
- tmp_val = val;
- while (tmp_val >>= 1)
- exp++;
+ exp = ilog2(val);
mant = (val * 1000 / (1<<exp));
ix = (u8)((mant-1000)/100); /* index of the LUT */
val = (lut_1000ln_mant[ix] + 693*(exp-20) - 6908);
--
1.8.4.5
--
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