Skip to content

Commit e9a8446

Browse files
ribaldamchehab
authored andcommitted
media: dvb-frontends: tda18271c2dd: Remove casting during div
do_div() divides 64 bits by 32. We were adding a casting to the divider to 64 bits, for a number that fits perfectly in 32 bits. Remove it. Found by cocci: drivers/media/dvb-frontends/tda18271c2dd.c:355:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead. drivers/media/dvb-frontends/tda18271c2dd.c:331:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead. Link: https://lore.kernel.org/linux-media/[email protected] Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent cfffeef commit e9a8446

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/media/dvb-frontends/tda18271c2dd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ static int CalcMainPLL(struct tda_state *state, u32 freq)
328328

329329
OscFreq = (u64) freq * (u64) Div;
330330
OscFreq *= (u64) 16384;
331-
do_div(OscFreq, (u64)16000000);
331+
do_div(OscFreq, 16000000);
332332
MainDiv = OscFreq;
333333

334334
state->m_Regs[MPD] = PostDiv & 0x77;
@@ -352,7 +352,7 @@ static int CalcCalPLL(struct tda_state *state, u32 freq)
352352
OscFreq = (u64)freq * (u64)Div;
353353
/* CalDiv = u32( OscFreq * 16384 / 16000000 ); */
354354
OscFreq *= (u64)16384;
355-
do_div(OscFreq, (u64)16000000);
355+
do_div(OscFreq, 16000000);
356356
CalDiv = OscFreq;
357357

358358
state->m_Regs[CPD] = PostDiv;

0 commit comments

Comments
 (0)