Commit f78028b6 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

[media] tda18271: fix calculation bug in tda18271_rf_tracking_filters_init

Misplaced parenthesis cause a calculation bug in
tda18271_rf_tracking_filters_init

Thanks to Stefan Sibiga for pointing this out.

Cc: Stefan Sibiga <stefansibiga@yahoo.ca>
Signed-off-by: default avatarMichael Krufky <mkrufky@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 2578dfb7
...@@ -616,15 +616,15 @@ static int tda18271_rf_tracking_filters_init(struct dvb_frontend *fe, u32 freq) ...@@ -616,15 +616,15 @@ static int tda18271_rf_tracking_filters_init(struct dvb_frontend *fe, u32 freq)
map[i].rf1 = rf_freq[RF1] / 1000; map[i].rf1 = rf_freq[RF1] / 1000;
break; break;
case RF2: case RF2:
dividend = (s32)(prog_cal[RF2] - prog_tab[RF2]) - dividend = (s32)(prog_cal[RF2] - prog_tab[RF2] -
(s32)(prog_cal[RF1] + prog_tab[RF1]); prog_cal[RF1] + prog_tab[RF1]);
divisor = (s32)(rf_freq[RF2] - rf_freq[RF1]) / 1000; divisor = (s32)(rf_freq[RF2] - rf_freq[RF1]) / 1000;
map[i].rf_a1 = (dividend / divisor); map[i].rf_a1 = (dividend / divisor);
map[i].rf2 = rf_freq[RF2] / 1000; map[i].rf2 = rf_freq[RF2] / 1000;
break; break;
case RF3: case RF3:
dividend = (s32)(prog_cal[RF3] - prog_tab[RF3]) - dividend = (s32)(prog_cal[RF3] - prog_tab[RF3] -
(s32)(prog_cal[RF2] + prog_tab[RF2]); prog_cal[RF2] + prog_tab[RF2]);
divisor = (s32)(rf_freq[RF3] - rf_freq[RF2]) / 1000; divisor = (s32)(rf_freq[RF3] - rf_freq[RF2]) / 1000;
map[i].rf_a2 = (dividend / divisor); map[i].rf_a2 = (dividend / divisor);
map[i].rf_b2 = (s32)(prog_cal[RF2] - prog_tab[RF2]); map[i].rf_b2 = (s32)(prog_cal[RF2] - prog_tab[RF2]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment