upstream: [media] vb2: simplify a confusing condition
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 24 Feb 2014 18:52:04 +0000 (15:52 -0300)
committerChanho Park <chanho61.park@samsung.com>
Thu, 7 Aug 2014 05:26:48 +0000 (14:26 +0900)
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 87c8fe1..82db407 100644 (file)
@@ -1150,9 +1150,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;
        }