media: rc: decoders do not need to check for transitions
authorSean Young <sean@mess.org>
Thu, 10 May 2018 10:14:38 +0000 (06:14 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 14 May 2018 11:16:24 +0000 (07:16 -0400)
Drivers should never produce consecutive pulse or space raw events. Should
that occur, we would have bigger problems than this code is trying to
guard against.

Note that we already log an error should a driver misbehave.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/rc/ir-mce_kbd-decoder.c
drivers/media/rc/ir-rc5-decoder.c
drivers/media/rc/ir-rc6-decoder.c

index 9574c3dd90f2c5d05912e1c4829aa66f2647053f..64ea429276693a43c2e5af7bcc9f3ab8afce955c 100644 (file)
@@ -274,9 +274,6 @@ again:
                return 0;
 
        case STATE_HEADER_BIT_END:
-               if (!is_transition(&ev, &dev->raw->prev_ev))
-                       break;
-
                decrease_duration(&ev, MCIR2_BIT_END);
 
                if (data->count != MCIR2_HEADER_NBITS) {
@@ -313,9 +310,6 @@ again:
                return 0;
 
        case STATE_BODY_BIT_END:
-               if (!is_transition(&ev, &dev->raw->prev_ev))
-                       break;
-
                if (data->count == data->wanted_bits)
                        data->state = STATE_FINISHED;
                else
index cbfaadbee8fa7d0b171ea472a117115483787218..63624654a71eaed04f5f8a47c2925aceb916d476 100644 (file)
@@ -88,9 +88,6 @@ again:
                return 0;
 
        case STATE_BIT_END:
-               if (!is_transition(&ev, &dev->raw->prev_ev))
-                       break;
-
                if (data->count == CHECK_RC5X_NBITS)
                        data->state = STATE_CHECK_RC5X;
                else
index 66e07109f6fcc53b133e5710b219843a4b3f3d03..68487ce9f79b618e213aaba9dcb0a5ae069baf15 100644 (file)
@@ -145,9 +145,6 @@ again:
                return 0;
 
        case STATE_HEADER_BIT_END:
-               if (!is_transition(&ev, &dev->raw->prev_ev))
-                       break;
-
                if (data->count == RC6_HEADER_NBITS)
                        data->state = STATE_TOGGLE_START;
                else
@@ -165,10 +162,6 @@ again:
                return 0;
 
        case STATE_TOGGLE_END:
-               if (!is_transition(&ev, &dev->raw->prev_ev) ||
-                   !geq_margin(ev.duration, RC6_TOGGLE_END, RC6_UNIT / 2))
-                       break;
-
                if (!(data->header & RC6_STARTBIT_MASK)) {
                        dev_dbg(&dev->dev, "RC6 invalid start bit\n");
                        break;
@@ -210,9 +203,6 @@ again:
                break;
 
        case STATE_BODY_BIT_END:
-               if (!is_transition(&ev, &dev->raw->prev_ev))
-                       break;
-
                if (data->count == data->wanted_bits)
                        data->state = STATE_FINISHED;
                else