diff options
author | Manu Abraham <abraham.manu@gmail.com> | 2009-04-08 19:18:50 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 17:20:39 -0400 |
commit | f430fff101dd2cdbf5db1cf274a1591ae2b6e05c (patch) | |
tree | 8e5aaf45ff2092bf801ad87772d83d739d581134 | |
parent | 15bb366e86e07820374ec313170aab65d4e1d983 (diff) |
V4L/DVB (11589): stv090x: code simplification
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb/frontends/stv090x.c | 14 |
1 files 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) | |||
1368 | { | 1368 | { |
1369 | u8 r3, r2, r1, r0; | 1369 | u8 r3, r2, r1, r0; |
1370 | s32 srate, int_1, int_2, tmp_1, tmp_2; | 1370 | s32 srate, int_1, int_2, tmp_1, tmp_2; |
1371 | u32 pow2; | ||
1372 | 1371 | ||
1373 | r3 = STV090x_READ_DEMOD(state, SFR3); | 1372 | r3 = STV090x_READ_DEMOD(state, SFR3); |
1374 | r2 = STV090x_READ_DEMOD(state, SFR2); | 1373 | r2 = STV090x_READ_DEMOD(state, SFR2); |
@@ -1377,16 +1376,15 @@ static u32 stv090x_get_srate(struct stv090x_state *state, u32 clk) | |||
1377 | 1376 | ||
1378 | srate = ((r3 << 24) | (r2 << 16) | (r1 << 8) | r0); | 1377 | srate = ((r3 << 24) | (r2 << 16) | (r1 << 8) | r0); |
1379 | 1378 | ||
1380 | pow2 = 1 << 16; | 1379 | int_1 = clk >> 16; |
1381 | int_1 = clk / pow2; | 1380 | int_2 = srate >> 16; |
1382 | int_2 = srate / pow2; | ||
1383 | 1381 | ||
1384 | tmp_1 = clk % pow2; | 1382 | tmp_1 = clk % 0x10000; |
1385 | tmp_2 = srate % pow2; | 1383 | tmp_2 = srate % 0x10000; |
1386 | 1384 | ||
1387 | srate = (int_1 * int_2) + | 1385 | srate = (int_1 * int_2) + |
1388 | ((int_1 * tmp_2) / pow2) + | 1386 | ((int_1 * tmp_2) >> 16) + |
1389 | ((int_2 * tmp_1) / pow2); | 1387 | ((int_2 * tmp_1) >> 16); |
1390 | 1388 | ||
1391 | return srate; | 1389 | return srate; |
1392 | } | 1390 | } |