diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-02-12 17:27:18 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-05-06 14:44:17 +0300 |
commit | 8a73faab0a6b6c620c62f24fc991d0ad653b848b (patch) | |
tree | 94239a2e956abe22227941a0c26834fb6947ca59 /drivers/media/dvb-frontends | |
parent | 68af062b5f38510dc96635314461c6bbe1dbf2fe (diff) | |
download | linux-8a73faab0a6b6c620c62f24fc991d0ad653b848b.tar.xz |
[media] zl10353: use div_u64 instead of do_div
Using div_u64() instead of do_div() makes the code slightly more
readable by humans.
[mchehab@osg.samsung.org: originally, this patch was proposed as a bug
fix for a gcc bug. This was solved already, but it is still better to
use div_u64, instead of do_div, so I'm applying it, removing the
comments about the gcc bug]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r-- | drivers/media/dvb-frontends/zl10353.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/dvb-frontends/zl10353.c b/drivers/media/dvb-frontends/zl10353.c index 1832c2f7695c..3b08176d7bec 100644 --- a/drivers/media/dvb-frontends/zl10353.c +++ b/drivers/media/dvb-frontends/zl10353.c @@ -135,8 +135,7 @@ static void zl10353_calc_nominal_rate(struct dvb_frontend *fe, value = (u64)10 * (1 << 23) / 7 * 125; value = (bw * value) + adc_clock / 2; - do_div(value, adc_clock); - *nominal_rate = value; + *nominal_rate = div_u64(value, adc_clock); dprintk("%s: bw %d, adc_clock %d => 0x%x\n", __func__, bw, adc_clock, *nominal_rate); @@ -163,8 +162,7 @@ static void zl10353_calc_input_freq(struct dvb_frontend *fe, if (ife > adc_clock / 2) ife = adc_clock - ife; } - value = (u64)65536 * ife + adc_clock / 2; - do_div(value, adc_clock); + value = div_u64((u64)65536 * ife + adc_clock / 2, adc_clock); *input_freq = -value; dprintk("%s: if2 %d, ife %d, adc_clock %d => %d / 0x%x\n", |