aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2011-07-13 17:26:06 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:55:59 -0400
commit2c594ffae40306ba1a5a5d59186cd3d49dc3ad6a (patch)
treeb857ccbdf695102d8e5554883a76b0808cc3fc56
parent68b2a69d10bf29cf5dcd779be18f96c8be8326d5 (diff)
[media] redrat3: cap duration in the right place
Trying to cap duration before multiplying it was obviously wrong. CC: Chris Dodge <chris@redrat.co.uk> CC: Andrew Vincer <andrew.vincer@redrat.co.uk> CC: Stephen Cox <scox_nz@yahoo.com> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/rc/redrat3.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
index 95a9436a2731..ea5039b88c50 100644
--- a/drivers/media/rc/redrat3.c
+++ b/drivers/media/rc/redrat3.c
@@ -496,9 +496,6 @@ static void redrat3_process_ir_data(struct redrat3_dev *rr3)
496 u16 val = len_vals[data_vals[i]]; 496 u16 val = len_vals[data_vals[i]];
497 single_len = redrat3_len_to_us((u32)be16_to_cpu(val)); 497 single_len = redrat3_len_to_us((u32)be16_to_cpu(val));
498 498
499 /* cap the value to IR_MAX_DURATION */
500 single_len &= IR_MAX_DURATION;
501
502 /* we should always get pulse/space/pulse/space samples */ 499 /* we should always get pulse/space/pulse/space samples */
503 if (i % 2) 500 if (i % 2)
504 rawir.pulse = false; 501 rawir.pulse = false;
@@ -506,6 +503,9 @@ static void redrat3_process_ir_data(struct redrat3_dev *rr3)
506 rawir.pulse = true; 503 rawir.pulse = true;
507 504
508 rawir.duration = US_TO_NS(single_len); 505 rawir.duration = US_TO_NS(single_len);
506 /* cap the value to IR_MAX_DURATION */
507 rawir.duration &= IR_MAX_DURATION;
508
509 rr3_dbg(dev, "storing %s with duration %d (i: %d)\n", 509 rr3_dbg(dev, "storing %s with duration %d (i: %d)\n",
510 rawir.pulse ? "pulse" : "space", rawir.duration, i); 510 rawir.pulse ? "pulse" : "space", rawir.duration, i);
511 ir_raw_event_store_with_filter(rr3->rc, &rawir); 511 ir_raw_event_store_with_filter(rr3->rc, &rawir);