Commit 4b39c8f4 authored by Xia Jiang's avatar Xia Jiang Committed by Mauro Carvalho Chehab
Browse files

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: default avatarTomasz Figa <tfiga@chromium.org>
Signed-off-by: default avatarXia Jiang <xia.jiang@mediatek.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent d43c93f2
Loading
Loading
Loading
Loading
+2 −13
Original line number Diff line number Diff line
@@ -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;
}

+6 −2
Original line number Diff line number Diff line
@@ -32,6 +32,12 @@

#define MTK_JPEG_HW_TIMEOUT_MSEC 1000

/**
 * enum mtk_jpeg_ctx_state - states of the context state machine
 * @MTK_JPEG_INIT:		current state is initialized
 * @MTK_JPEG_RUNNING:		current state is running
 * @MTK_JPEG_SOURCE_CHANGE:	current state is source resolution change
 */
enum mtk_jpeg_ctx_state {
	MTK_JPEG_INIT = 0,
	MTK_JPEG_RUNNING,
@@ -113,9 +119,7 @@ struct mtk_jpeg_q_data {
 * @out_q:		source (output) queue information
 * @cap_q:		destination (capture) queue queue information
 * @fh:			V4L2 file handle
 * @dec_param		parameters for HW decoding
 * @state:		state of the context
 * @header_valid:	set if header has been parsed and valid
 * @colorspace: enum v4l2_colorspace; supplemental to pixelformat
 * @ycbcr_enc: enum v4l2_ycbcr_encoding, Y'CbCr encoding
 * @quantization: enum v4l2_quantization, colorspace quantization