Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a73faab authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarArnd Bergmann <arnd@arndb.de>

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 68af062b
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -135,8 +135,7 @@ static void zl10353_calc_nominal_rate(struct dvb_frontend *fe,


	value = (u64)10 * (1 << 23) / 7 * 125;
	value = (u64)10 * (1 << 23) / 7 * 125;
	value = (bw * value) + adc_clock / 2;
	value = (bw * value) + adc_clock / 2;
	do_div(value, adc_clock);
	*nominal_rate = div_u64(value, adc_clock);
	*nominal_rate = value;


	dprintk("%s: bw %d, adc_clock %d => 0x%x\n",
	dprintk("%s: bw %d, adc_clock %d => 0x%x\n",
		__func__, bw, adc_clock, *nominal_rate);
		__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)
		if (ife > adc_clock / 2)
			ife = adc_clock - ife;
			ife = adc_clock - ife;
	}
	}
	value = (u64)65536 * ife + adc_clock / 2;
	value = div_u64((u64)65536 * ife + adc_clock / 2, adc_clock);
	do_div(value, adc_clock);
	*input_freq = -value;
	*input_freq = -value;


	dprintk("%s: if2 %d, ife %d, adc_clock %d => %d / 0x%x\n",
	dprintk("%s: if2 %d, ife %d, adc_clock %d => %d / 0x%x\n",