[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4d1d6ad7.857a0e0a.45e5.ffffd91b@mx.google.com>
Date: Fri, 27 Aug 2010 14:43:07 +0400
From: "Igor M. Liplianin" <liplianin@...by>
To: <mchehab@...radead.org>, linux-media@...r.kernel.org,
<linux-kernel@...r.kernel.org>, <aospan@...up.ru>
Subject: [PATCH 09/18] stv0367: Fix potential divide error
Signed-off-by: Igor M. Liplianin <liplianin@...up.ru>
---
drivers/media/dvb/frontends/stv0367.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/media/dvb/frontends/stv0367.c b/drivers/media/dvb/frontends/stv0367.c
index 0575741..e6bee7f 100644
--- a/drivers/media/dvb/frontends/stv0367.c
+++ b/drivers/media/dvb/frontends/stv0367.c
@@ -3275,12 +3275,14 @@ static int stv0367cab_read_snr(struct dvb_frontend *fe, u16 *snr)
power = 1;
break;
}
+
for (i = 0; i < 10; i++) {
regval += (stv0367_readbits(state, F367CAB_SNR_LO)
+ 256 * stv0367_readbits(state, F367CAB_SNR_HI));
}
+
+ regval /= 10; /*for average over 10 times in for loop above*/
if (regval != 0) {
- regval /= 10; /*for average over 10 times in for loop above*/
temp = power
* (1 << (3 + stv0367_readbits(state, F367CAB_SNR_PER)));
temp /= regval;
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists