Skip to contentSkip to conversation

dvb: l64781.ko broken with gcc 4.5

PATCH New Greg KH 1 participant 1 message Feb 9, 2010 Media (V4L/DVB)

lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 dvb: l64781.ko broken with gcc 4.5

From: Richard Guenther <[email protected]>

I'm trying to fix it on the GCC side (PR43007), but the module is quite stupid in using ULL constants to operate on u32 values:

static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_parameters *param)
{
...
static const u32 ppm = 8000;
u32 spi_bias;
...

spi_bias *= 1000ULL;
spi_bias /= 1000ULL + ppm/1000;

which causes current GCC 4.5 to emit calls to __udivdi3 for i?86 again.

This patch fixes this issue.

Cc Andreas Gruenbacher <[email protected]>
Cc stable <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Cc Matthias Schwarzott <[email protected]>
Cc Douglas Schilling Landgraf <[email protected]>
Cc Andreas Oberritter <[email protected]>
---
 drivers/media/dvb/frontends/l64781.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/dvb/frontends/l64781.c +2 -2
@@ -192,8 +192,8 @@ static int apply_frontend_param (struct
 	spi_bias *= qam_tab[p->constellation];
 	spi_bias /= p->code_rate_HP + 1;
 	spi_bias /= (guard_tab[p->guard_interval] + 32);
-	spi_bias *= 1000ULL;
-	spi_bias /= 1000ULL + ppm/1000;
+	spi_bias *= 1000;
+	spi_bias /= 1000 + ppm/1000;
 	spi_bias *= p->code_rate_HP;
 
 	val0x04 = (p->transmission_mode << 2) | p->guard_interval;