diff options
author | Manu Abraham <manu@linuxtv.org> | 2009-04-09 03:18:50 +0400 |
---|---|---|
committer | Manu Abraham <manu@linuxtv.org> | 2009-04-09 03:18:50 +0400 |
commit | c3403e5da51196983e3245ef276ee773ed2e9877 (patch) | |
tree | f7b84157df868e079062702db02af35ee5ce095a /linux/drivers/media/dvb/frontends/stv090x.c | |
parent | f0275699c613cb8cbe3aebf02b8db03c68ba28f1 (diff) | |
download | mediapointer-dvb-s2-c3403e5da51196983e3245ef276ee773ed2e9877.tar.gz mediapointer-dvb-s2-c3403e5da51196983e3245ef276ee773ed2e9877.tar.bz2 |
Code simplification
From: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/dvb/frontends/stv090x.c')
-rw-r--r-- | linux/drivers/media/dvb/frontends/stv090x.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/linux/drivers/media/dvb/frontends/stv090x.c b/linux/drivers/media/dvb/frontends/stv090x.c index 3a98731f0..17f8d7e41 100644 --- a/linux/drivers/media/dvb/frontends/stv090x.c +++ b/linux/drivers/media/dvb/frontends/stv090x.c @@ -2153,7 +2153,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); @@ -2162,16 +2161,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; } |