diff options
author | Gustavo A. R. Silva <gustavo@embeddedor.com> | 2018-02-06 11:49:04 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-02-26 08:08:46 -0500 |
commit | 07837433ca4d7cf1bfd27d4776956cc7a7bf921d (patch) | |
tree | 3d457dfc4ecea9142600e6305f8f54ca81f980dc /drivers/media/pci/cx88 | |
parent | a2603d1748fddaa44b70b027737ba077145f261c (diff) |
media: pci: cx88-input: use 64-bit arithmetic instead of 32-bit
Add suffix LL to constant 1000000 in order to give the compiler
complete information about the proper arithmetic to use. Notice
that this constant is used in a context that expects an expression
of type ktime_t (64 bits, signed).
The expression ir->polling * 1000000 is currently being evaluated
using 32-bit arithmetic.
Addresses-Coverity-ID: 1392628 ("Unintentional integer overflow")
Addresses-Coverity-ID: 1392630 ("Unintentional integer overflow")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/pci/cx88')
-rw-r--r-- | drivers/media/pci/cx88/cx88-input.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c index 4e9953e61a12..6f4e6923a91a 100644 --- a/drivers/media/pci/cx88/cx88-input.c +++ b/drivers/media/pci/cx88/cx88-input.c | |||
@@ -180,7 +180,7 @@ static enum hrtimer_restart cx88_ir_work(struct hrtimer *timer) | |||
180 | struct cx88_IR *ir = container_of(timer, struct cx88_IR, timer); | 180 | struct cx88_IR *ir = container_of(timer, struct cx88_IR, timer); |
181 | 181 | ||
182 | cx88_ir_handle_key(ir); | 182 | cx88_ir_handle_key(ir); |
183 | missed = hrtimer_forward_now(&ir->timer, ir->polling * 1000000); | 183 | missed = hrtimer_forward_now(&ir->timer, ir->polling * 1000000LL); |
184 | if (missed > 1) | 184 | if (missed > 1) |
185 | ir_dprintk("Missed ticks %ld\n", missed - 1); | 185 | ir_dprintk("Missed ticks %ld\n", missed - 1); |
186 | 186 | ||
@@ -200,7 +200,7 @@ static int __cx88_ir_start(void *priv) | |||
200 | if (ir->polling) { | 200 | if (ir->polling) { |
201 | hrtimer_init(&ir->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); | 201 | hrtimer_init(&ir->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); |
202 | ir->timer.function = cx88_ir_work; | 202 | ir->timer.function = cx88_ir_work; |
203 | hrtimer_start(&ir->timer, ir->polling * 1000000, | 203 | hrtimer_start(&ir->timer, ir->polling * 1000000LL, |
204 | HRTIMER_MODE_REL); | 204 | HRTIMER_MODE_REL); |
205 | } | 205 | } |
206 | if (ir->sampling) { | 206 | if (ir->sampling) { |