This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: coda: jpeg: improve header parse error message
Author:  Philipp Zabel <[email protected]>
Date:    Wed Apr 6 09:53:52 2022 +0100

If JPEG header parsing fails, output a single message instead of two
messages that say the same thing.

Signed-off-by: Philipp Zabel <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/platform/chips-media/coda-common.c | 6 +-----
 drivers/media/platform/chips-media/coda-jpeg.c   | 6 ++----
 2 files changed, 3 insertions(+), 9 deletions(-)

---

diff --git a/drivers/media/platform/chips-media/coda-common.c 
b/drivers/media/platform/chips-media/coda-common.c
index 93ac519ae2f1..3eaf0e7e6b20 100644
--- a/drivers/media/platform/chips-media/coda-common.c
+++ b/drivers/media/platform/chips-media/coda-common.c
@@ -2000,12 +2000,8 @@ static int coda_start_streaming(struct vb2_queue *q, 
unsigned int count)
                if (q_data_src->fourcc == V4L2_PIX_FMT_JPEG) {
                        buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
                        ret = coda_jpeg_decode_header(ctx, &buf->vb2_buf);
-                       if (ret < 0) {
-                               v4l2_err(v4l2_dev,
-                                        "failed to decode JPEG header: %d\n",
-                                        ret);
+                       if (ret < 0)
                                goto err;
-                       }
 
                        q_data_dst = get_q_data(ctx, 
V4L2_BUF_TYPE_VIDEO_CAPTURE);
                        q_data_dst->width = round_up(q_data_src->width, 16);
diff --git a/drivers/media/platform/chips-media/coda-jpeg.c 
b/drivers/media/platform/chips-media/coda-jpeg.c
index dcb0bd662105..a0b22b07f69a 100644
--- a/drivers/media/platform/chips-media/coda-jpeg.c
+++ b/drivers/media/platform/chips-media/coda-jpeg.c
@@ -283,7 +283,8 @@ int coda_jpeg_decode_header(struct coda_ctx *ctx, struct 
vb2_buffer *vb)
 
        ret = v4l2_jpeg_parse_header(buf, len, &header);
        if (ret < 0) {
-               v4l2_err(&dev->v4l2_dev, "failed to parse header\n");
+               v4l2_err(&dev->v4l2_dev, "failed to parse JPEG header: %pe\n",
+                        ERR_PTR(ret));
                return ret;
        }
 
@@ -1349,9 +1350,6 @@ static int coda9_jpeg_prepare_decode(struct coda_ctx *ctx)
 
        ret = coda_jpeg_decode_header(ctx, &src_buf->vb2_buf);
        if (ret < 0) {
-               v4l2_err(&dev->v4l2_dev, "failed to decode JPEG header: %d\n",
-                        ret);
-
                src_buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
                dst_buf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
                v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_DONE);

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to