From: Mauro Carvalho Chehab Date: Wed, 24 Sep 2014 01:29:41 +0000 (-0300) Subject: [media] qm1d1c0042: fix compilation on 32 bits X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=46cebe017afd03614b17c70ed5ed2734ec3796f7;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [media] qm1d1c0042: fix compilation on 32 bits drivers/built-in.o: In function `qm1d1c0042_set_params': >> qm1d1c0042.c:(.text+0x2519730): undefined reference to `__divdi3' Reported-by: kbuild test robot Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/tuners/qm1d1c0042.c b/drivers/media/tuners/qm1d1c0042.c index 585594b9c4f8..18bc745ed108 100644 --- a/drivers/media/tuners/qm1d1c0042.c +++ b/drivers/media/tuners/qm1d1c0042.c @@ -28,6 +28,7 @@ */ #include +#include #include "qm1d1c0042.h" #define QM1D1C0042_NUM_REGS 0x20 @@ -234,7 +235,9 @@ static int qm1d1c0042_set_params(struct dvb_frontend *fe) * sd = b (b >= 0) * 1<<22 + b (b < 0) */ - b = (((s64) freq) << 20) / state->cfg.xtal_freq - (((s64) a) << 20); + b = (s32)div64_s64(((s64) freq) << 20, state->cfg.xtal_freq) + - (((s64) a) << 20); + if (b >= 0) sd = b; else