summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
diff options
context:
space:
mode:
authorXia Jiang <xia.jiang@mediatek.com>2020-08-14 09:11:48 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-08-28 15:30:30 +0200
commit4b39c8f453b21718e589d849d49c5edf6713235d (patch)
treeb4cc01e58235cdd6170f09b28b2595f1605a9ccd /drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
parentd43c93f2db82501af759499345d2a332183a0065 (diff)
downloadlinux-4b39c8f453b21718e589d849d49c5edf6713235d.tar.bz2
media: platform: Delete redundant code and add annotation for an enum
Delete unused member variables annotation. Delete unused variable definition. Delete redundant log print, because V4L2 debug logs already print it. Add annotation for enum mtk_jpeg_ctx_state. Reviewed-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Xia Jiang <xia.jiang@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c')
-rw-r--r--drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
index cd3572c18f55..7e75bc125c01 100644
--- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
@@ -176,14 +176,13 @@ static int mtk_jpeg_try_fmt_mplane(struct v4l2_format *f,
struct mtk_jpeg_ctx *ctx, int q_type)
{
struct v4l2_pix_format_mplane *pix_mp = &f->fmt.pix_mp;
- struct mtk_jpeg_dev *jpeg = ctx->jpeg;
int i;
pix_mp->field = V4L2_FIELD_NONE;
if (ctx->state != MTK_JPEG_INIT) {
mtk_jpeg_adjust_fmt_mplane(ctx, f);
- goto end;
+ return 0;
}
pix_mp->num_planes = fmt->colplanes;
@@ -202,7 +201,7 @@ static int mtk_jpeg_try_fmt_mplane(struct v4l2_format *f,
pfmt->sizeimage = round_up(pfmt->sizeimage, 128);
if (pfmt->sizeimage == 0)
pfmt->sizeimage = MTK_JPEG_DEFAULT_SIZEIMAGE;
- goto end;
+ return 0;
}
/* type is MTK_JPEG_FMT_TYPE_CAPTURE */
@@ -219,16 +218,6 @@ static int mtk_jpeg_try_fmt_mplane(struct v4l2_format *f,
pfmt->bytesperline = stride;
pfmt->sizeimage = stride * h;
}
-end:
- v4l2_dbg(2, debug, &jpeg->v4l2_dev, "wxh:%ux%u\n",
- pix_mp->width, pix_mp->height);
- for (i = 0; i < pix_mp->num_planes; i++) {
- v4l2_dbg(2, debug, &jpeg->v4l2_dev,
- "plane[%d] bpl=%u, size=%u\n",
- i,
- pix_mp->plane_fmt[i].bytesperline,
- pix_mp->plane_fmt[i].sizeimage);
- }
return 0;
}