summaryrefslogtreecommitdiff
path: root/drivers/media/usb/dvb-usb-v2
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-06-23 15:22:06 (GMT)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-06-24 11:38:30 (GMT)
commit5ae65db547f3a9887d4edfa2c272879a72fd4f5f (patch)
treeed6061aa01c9ff3e86d97b782a9631f3bf5c5aed /drivers/media/usb/dvb-usb-v2
parent7fd6bd9df1868983ce59ca8fd5d796c5b63100a5 (diff)
downloadlinux-5ae65db547f3a9887d4edfa2c272879a72fd4f5f.tar.xz
[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>
Diffstat (limited to 'drivers/media/usb/dvb-usb-v2')
-rw-r--r--drivers/media/usb/dvb-usb-v2/lmedm04.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/lmedm04.c b/drivers/media/usb/dvb-usb-v2/lmedm04.c
index 57fb184..fcef2a3 100644
--- a/drivers/media/usb/dvb-usb-v2/lmedm04.c
+++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c
@@ -262,7 +262,7 @@ static void lme2510_update_stats(struct dvb_usb_adapter *adap)
struct lme2510_state *st = adap_to_priv(adap);
struct dvb_frontend *fe = adap->fe[0];
struct dtv_frontend_properties *c;
- u64 s_tmp = 0, c_tmp = 0;
+ u32 s_tmp = 0, c_tmp = 0;
if (!fe)
return;
@@ -309,11 +309,11 @@ static void lme2510_update_stats(struct dvb_usb_adapter *adap)
c->strength.len = 1;
c->strength.stat[0].scale = FE_SCALE_RELATIVE;
- c->strength.stat[0].uvalue = s_tmp;
+ c->strength.stat[0].uvalue = (u64)s_tmp;
c->cnr.len = 1;
c->cnr.stat[0].scale = FE_SCALE_RELATIVE;
- c->cnr.stat[0].uvalue = c_tmp;
+ c->cnr.stat[0].uvalue = (u64)c_tmp;
}
static void lme2510_int_response(struct urb *lme_urb)