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

[media] lmedm04: use u32 instead of u64 for relative stats

Cleanup this sparse warning:
drivers/media/usb/dvb-usb-v2/lmedm04.c:302 lme2510_update_stats() warn: should '((255 - st->signal_sn - 161) * 3) << 8' be a 64 bit type?

Both c_tmp and s_tmp actually stores a u16 stat. Using a u64 data
there is a waste, specially on u32 archs, as 64 ints there are more
expensive.

So, change the types to u32 and do the typecast only when storing
the result.

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

+3 -3
+3 -3
drivers/media/usb/dvb-usb-v2/lmedm04.c
··· 262 262 struct lme2510_state *st = adap_to_priv(adap); 263 263 struct dvb_frontend *fe = adap->fe[0]; 264 264 struct dtv_frontend_properties *c; 265 - u64 s_tmp = 0, c_tmp = 0; 265 + u32 s_tmp = 0, c_tmp = 0; 266 266 267 267 if (!fe) 268 268 return; ··· 309 309 310 310 c->strength.len = 1; 311 311 c->strength.stat[0].scale = FE_SCALE_RELATIVE; 312 - c->strength.stat[0].uvalue = s_tmp; 312 + c->strength.stat[0].uvalue = (u64)s_tmp; 313 313 314 314 c->cnr.len = 1; 315 315 c->cnr.stat[0].scale = FE_SCALE_RELATIVE; 316 - c->cnr.stat[0].uvalue = c_tmp; 316 + c->cnr.stat[0].uvalue = (u64)c_tmp; 317 317 } 318 318 319 319 static void lme2510_int_response(struct urb *lme_urb)