Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (11877): lgdt3305: fix 64bit division in function lgdt3305_set_if

Signed-off-by: Michael Krufky <kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Michael Krufky and committed by
Mauro Carvalho Chehab
511da457 a5beb7b3

+3 -14
+3 -14
drivers/media/dvb/frontends/lgdt3305.c
··· 19 19 * 20 20 */ 21 21 22 + #include <asm/div64.h> 22 23 #include <linux/dvb/frontend.h> 23 24 #include "dvb_math.h" 24 25 #include "lgdt3305.h" ··· 497 496 498 497 nco = if_freq_khz / 10; 499 498 500 - #define LGDT3305_64BIT_DIVISION_ENABLED 0 501 - /* FIXME: 64bit division disabled to avoid linking error: 502 - * WARNING: "__udivdi3" [lgdt3305.ko] undefined! 503 - */ 504 499 switch (param->u.vsb.modulation) { 505 500 case VSB_8: 506 - #if LGDT3305_64BIT_DIVISION_ENABLED 507 501 nco <<= 24; 508 - nco /= 625; 509 - #else 510 - nco *= ((1 << 24) / 625); 511 - #endif 502 + do_div(nco, 625); 512 503 break; 513 504 case QAM_64: 514 505 case QAM_256: 515 - #if LGDT3305_64BIT_DIVISION_ENABLED 516 506 nco <<= 28; 517 - nco /= 625; 518 - #else 519 - nco *= ((1 << 28) / 625); 520 - #endif 507 + do_div(nco, 625); 521 508 break; 522 509 default: 523 510 return -EINVAL;