aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@kernellabs.com>2009-09-27 16:00:13 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:40:23 -0500
commit3986bd116f3c53d695aef1781e14b6c5670d4cdd (patch)
tree805fd3f8cac0c4f60e1ec24c6e9f74783d0b2367 /drivers/media/common
parentb450b92e162a454b82fea6373c83e447e28ce4d6 (diff)
V4L/DVB (13110): tda18271: use temporary variables in tda18271_rf_tracking_filters_init
Use temporary variables for signed calulations between unsigned values Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r--drivers/media/common/tuners/tda18271-fe.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/media/common/tuners/tda18271-fe.c b/drivers/media/common/tuners/tda18271-fe.c
index 3a50ce96fcb9..8b515a7d93f8 100644
--- a/drivers/media/common/tuners/tda18271-fe.c
+++ b/drivers/media/common/tuners/tda18271-fe.c
@@ -572,6 +572,7 @@ static int tda18271_rf_tracking_filters_init(struct dvb_frontend *fe, u32 freq)
572 struct tda18271_rf_tracking_filter_cal *map = priv->rf_cal_state; 572 struct tda18271_rf_tracking_filter_cal *map = priv->rf_cal_state;
573 unsigned char *regs = priv->tda18271_regs; 573 unsigned char *regs = priv->tda18271_regs;
574 int bcal, rf, i; 574 int bcal, rf, i;
575 s32 divisor, dividend;
575#define RF1 0 576#define RF1 0
576#define RF2 1 577#define RF2 1
577#define RF3 2 578#define RF3 2
@@ -614,15 +615,17 @@ static int tda18271_rf_tracking_filters_init(struct dvb_frontend *fe, u32 freq)
614 map[i].rf1 = rf_freq[RF1] / 1000; 615 map[i].rf1 = rf_freq[RF1] / 1000;
615 break; 616 break;
616 case RF2: 617 case RF2:
617 map[i].rf_a1 = (prog_cal[RF2] - prog_tab[RF2] - 618 dividend = (s32)(prog_cal[RF2] - prog_tab[RF2]) -
618 prog_cal[RF1] + prog_tab[RF1]) / 619 (s32)(prog_cal[RF1] + prog_tab[RF1]);
619 (s32)((rf_freq[RF2] - rf_freq[RF1]) / 1000); 620 divisor = (s32)(rf_freq[RF2] - rf_freq[RF1]) / 1000;
621 map[i].rf_a1 = (dividend / divisor);
620 map[i].rf2 = rf_freq[RF2] / 1000; 622 map[i].rf2 = rf_freq[RF2] / 1000;
621 break; 623 break;
622 case RF3: 624 case RF3:
623 map[i].rf_a2 = (prog_cal[RF3] - prog_tab[RF3] - 625 dividend = (s32)(prog_cal[RF3] - prog_tab[RF3]) -
624 prog_cal[RF2] + prog_tab[RF2]) / 626 (s32)(prog_cal[RF2] + prog_tab[RF2]);
625 (s32)((rf_freq[RF3] - rf_freq[RF2]) / 1000); 627 divisor = (s32)(rf_freq[RF3] - rf_freq[RF2]) / 1000;
628 map[i].rf_a2 = (dividend / divisor);
626 map[i].rf_b2 = prog_cal[RF2] - prog_tab[RF2]; 629 map[i].rf_b2 = prog_cal[RF2] - prog_tab[RF2];
627 map[i].rf3 = rf_freq[RF3] / 1000; 630 map[i].rf3 = rf_freq[RF3] / 1000;
628 break; 631 break;