From f430fff101dd2cdbf5db1cf274a1591ae2b6e05c Mon Sep 17 00:00:00 2001 From: Manu Abraham Date: Wed, 8 Apr 2009 20:18:50 -0300 Subject: V4L/DVB (11589): stv090x: code simplification Signed-off-by: Manu Abraham Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/stv090x.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c index 6e7c47a1f67..fee7917ec5c 100644 --- a/drivers/media/dvb/frontends/stv090x.c +++ b/drivers/media/dvb/frontends/stv090x.c @@ -1368,7 +1368,6 @@ static u32 stv090x_get_srate(struct stv090x_state *state, u32 clk) { u8 r3, r2, r1, r0; s32 srate, int_1, int_2, tmp_1, tmp_2; - u32 pow2; r3 = STV090x_READ_DEMOD(state, SFR3); r2 = STV090x_READ_DEMOD(state, SFR2); @@ -1377,16 +1376,15 @@ static u32 stv090x_get_srate(struct stv090x_state *state, u32 clk) srate = ((r3 << 24) | (r2 << 16) | (r1 << 8) | r0); - pow2 = 1 << 16; - int_1 = clk / pow2; - int_2 = srate / pow2; + int_1 = clk >> 16; + int_2 = srate >> 16; - tmp_1 = clk % pow2; - tmp_2 = srate % pow2; + tmp_1 = clk % 0x10000; + tmp_2 = srate % 0x10000; srate = (int_1 * int_2) + - ((int_1 * tmp_2) / pow2) + - ((int_2 * tmp_1) / pow2); + ((int_1 * tmp_2) >> 16) + + ((int_2 * tmp_1) >> 16); return srate; } -- cgit v1.2.2