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

[media] tda10071: use div_s64() when dividing a s64 integer

Otherwise, it will break on 32 bits archs.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

+1 -1
+1 -1
drivers/media/dvb-frontends/tda10071.c
··· 527 527 unsigned int uitmp; 528 528 529 529 if (c->strength.stat[0].scale == FE_SCALE_DECIBEL) { 530 - uitmp = c->strength.stat[0].svalue / 1000 + 256; 530 + uitmp = div_s64(c->strength.stat[0].svalue, 1000) + 256; 531 531 uitmp = clamp(uitmp, 181U, 236U); /* -75dBm - -20dBm */ 532 532 /* scale value to 0x0000-0xffff */ 533 533 *strength = (uitmp-181) * 0xffff / (236-181);