]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
[media] tda18271: fix calculation bug in tda18271_rf_tracking_filters_init
authorMichael Krufky <mkrufky@kernellabs.com>
Sat, 16 Apr 2011 16:22:10 +0000 (13:22 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 19 Apr 2011 14:30:33 +0000 (11:30 -0300)
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: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/common/tuners/tda18271-fe.c

index 9ad4454a148d07040e03842bde866bf4dd42886a..42105d1c86136b5af07cff29c0eff58f82d6287b 100644 (file)
@@ -616,15 +616,15 @@ static int tda18271_rf_tracking_filters_init(struct dvb_frontend *fe, u32 freq)
                        map[i].rf1   = rf_freq[RF1] / 1000;
                        break;
                case RF2:
-                       dividend = (s32)(prog_cal[RF2] - prog_tab[RF2]) -
-                                  (s32)(prog_cal[RF1] + prog_tab[RF1]);
+                       dividend = (s32)(prog_cal[RF2] - prog_tab[RF2] -
+                                        prog_cal[RF1] + prog_tab[RF1]);
                        divisor = (s32)(rf_freq[RF2] - rf_freq[RF1]) / 1000;
                        map[i].rf_a1 = (dividend / divisor);
                        map[i].rf2   = rf_freq[RF2] / 1000;
                        break;
                case RF3:
-                       dividend = (s32)(prog_cal[RF3] - prog_tab[RF3]) -
-                                  (s32)(prog_cal[RF2] + prog_tab[RF2]);
+                       dividend = (s32)(prog_cal[RF3] - prog_tab[RF3] -
+                                        prog_cal[RF2] + prog_tab[RF2]);
                        divisor = (s32)(rf_freq[RF3] - rf_freq[RF2]) / 1000;
                        map[i].rf_a2 = (dividend / divisor);
                        map[i].rf_b2 = (s32)(prog_cal[RF2] - prog_tab[RF2]);