Skip to contentSkip to conversation

media: omap3isp: use vb2_buffer_state enum for vb2 buffer state

PATCH In review Lad Prabhakar 2 participants 2 messages Feb 25, 2015 – Nov 9, 2015 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: omap3isp: use vb2_buffer_state enum for vb2 buffer state

From: "Lad, Prabhakar" <[email protected]>

use the vb2_buffer_state enum for assigning the state
of the vb2 buffer, along side making isp_pipeline_state
state variable local to the block.
This fixes the following sparse warning as well:
drivers/media/platform/omap3isp/ispvideo.c:497:35: warning: mixing different enum types
drivers/media/platform/omap3isp/ispvideo.c:497:35: int enum isp_pipeline_state versus
drivers/media/platform/omap3isp/ispvideo.c:497:35: int enum vb2_buffer_state

---
 drivers/media/platform/omap3isp/ispvideo.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/media/platform/omap3isp/ispvideo.c +6 -4
index 3fe9047..8cd3a57 100644
@@ -449,7 +449,7 @@ static const struct vb2_ops isp_video_queue_ops = {
 struct isp_buffer *omap3isp_video_buffer_next(struct isp_video *video)
 {
 	struct isp_pipeline *pipe = to_isp_pipeline(&video->video.entity);
-	enum isp_pipeline_state state;
+	enum vb2_buffer_state vb_state;
 	struct isp_buffer *buf;
 	unsigned long flags;
 	struct timespec ts;
@@ -488,17 +488,19 @@ struct isp_buffer *omap3isp_video_buffer_next(struct isp_video *video)
 
 	/* Report pipeline errors to userspace on the capture device side. */
 	if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && pipe->error) {
-		state = VB2_BUF_STATE_ERROR;
+		vb_state = VB2_BUF_STATE_ERROR;
 		pipe->error = false;
 	} else {
-		state = VB2_BUF_STATE_DONE;
+		vb_state = VB2_BUF_STATE_DONE;
 	}
 
-	vb2_buffer_done(&buf->vb, state);
+	vb2_buffer_done(&buf->vb, vb_state);
 
 	spin_lock_irqsave(&video->irqlock, flags);
 
 	if (list_empty(&video->dmaqueue)) {
+		enum isp_pipeline_state state;
+
 		spin_unlock_irqrestore(&video->irqlock, flags);
 
 		if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Prabhakar,

Thank you for the patch.

Quoted 12 lines · On Wednesday 25 February 2015 15:58:14 Lad Prabhakar wrote:

From: "Lad, Prabhakar" <[email protected]>

use the vb2_buffer_state enum for assigning the state
of the vb2 buffer, along side making isp_pipeline_state
state variable local to the block.
This fixes the following sparse warning as well:
drivers/media/platform/omap3isp/ispvideo.c:497:35: warning: mixing different
enum types drivers/media/platform/omap3isp/ispvideo.c:497:35: int enum
isp_pipeline_state versus
drivers/media/platform/omap3isp/ispvideo.c:497:35: int enum
vb2_buffer_state

Quoted 1 line

and applied to my tree.

Quoted 41 lines
---
 drivers/media/platform/omap3isp/ispvideo.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/media/platform/omap3isp/ispvideo.c index 3fe9047..8cd3a57 100644

drivers/media/platform/omap3isp/ispvideo.c +6 -4
@@ -449,7 +449,7 @@ static const struct vb2_ops isp_video_queue_ops = {
 struct isp_buffer *omap3isp_video_buffer_next(struct isp_video *video)
 {
 	struct isp_pipeline *pipe = to_isp_pipeline(&video->video.entity);
-	enum isp_pipeline_state state;
+	enum vb2_buffer_state vb_state;
 	struct isp_buffer *buf;
 	unsigned long flags;
 	struct timespec ts;
@@ -488,17 +488,19 @@ struct isp_buffer *omap3isp_video_buffer_next(struct
 isp_video *video)
 
 	/* Report pipeline errors to userspace on the capture device side. */
 	if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && pipe->error) {
-		state = VB2_BUF_STATE_ERROR;
+		vb_state = VB2_BUF_STATE_ERROR;
 		pipe->error = false;
 	} else {
-		state = VB2_BUF_STATE_DONE;
+		vb_state = VB2_BUF_STATE_DONE;
 	}
 
-	vb2_buffer_done(&buf->vb, state);
+	vb2_buffer_done(&buf->vb, vb_state);
 
 	spin_lock_irqsave(&video->irqlock, flags);
 
 	if (list_empty(&video->dmaqueue)) {
+		enum isp_pipeline_state state;
+
 		spin_unlock_irqrestore(&video->irqlock, flags);
 

if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)

Signature · 3 lines
Regards,

Laurent Pinchart