[media] vb2: simplify a confusing condition
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 24 Feb 2014 18:52:04 +0000 (15:52 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Wed, 16 Apr 2014 21:47:20 +0000 (18:47 -0300)
q->start_streaming_called is always true, so the WARN_ON check against
it being false can be dropped.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/videobuf2-core.c

index 2eef5ef93e939a9bd76b4e25c369b01c2021c377..60fbb17cc91383685f3c4a0eb43caa082e1a5781 100644 (file)
@@ -1159,9 +1159,8 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state)
        if (!q->start_streaming_called) {
                if (WARN_ON(state != VB2_BUF_STATE_QUEUED))
                        state = VB2_BUF_STATE_QUEUED;
-       } else if (!WARN_ON(!q->start_streaming_called)) {
-               if (WARN_ON(state != VB2_BUF_STATE_DONE &&
-                           state != VB2_BUF_STATE_ERROR))
+       } else if (WARN_ON(state != VB2_BUF_STATE_DONE &&
+                          state != VB2_BUF_STATE_ERROR)) {
                        state = VB2_BUF_STATE_ERROR;
        }