From patchwork Fri Aug 14 07:11:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xia Jiang X-Patchwork-Id: 11713727 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD08814E3 for ; Fri, 14 Aug 2020 07:24:00 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94FCE20639 for ; Fri, 14 Aug 2020 07:24:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rqFg4Wnz"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="qQotuhIp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94FCE20639 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MSFMK2KdfT5Jr6OYV49gKZJ5vpB2S1wzzlXFfToOgBc=; b=rqFg4WnzgcSebomebw9+Ai8uB WH0XthfeIBMqoz2LoPYYHfQRfRRUVQdmsi0zflHaX6oS2JOI53aDRkdk+ZbBAJshG0PncDQ61HXAd Y8XVvsPo+g2VglNFVJArDgydhHZgD7JJ1fnSQpGwacH8fY9MJclQ7x7sStuAEKdxy1/4NuE0uPI3X dph3UYnD+I5I16h6Jtps4OWs5bIsAGNtRojWaW4euyMYr+FsrWEMTdamtZkB1OvqpHokBgOS2asbl IovAk4oIUJYvSqloTle52D8wMST4byRRyGDXfF0rzv+8us5aGTEY3YXRM05ihbYWf5XhXyfcb6kOm HmUrbJhew==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k6U44-0003eA-TJ; Fri, 14 Aug 2020 07:23:49 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k6U3a-0003N6-3o; Fri, 14 Aug 2020 07:23:19 +0000 X-UUID: 8b5e13835c72421c9fbaf88ad280fa95-20200813 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=ZQxsYXMiSFwPrZ111f4m+gouEH0cxDJ3i9R7i1HIQcc=; b=qQotuhIpYSzWX5egqZDxhBvZjQrZzIRNS218scN5VCiWRaeyEtLZfnV7MRy7iSz9Q01nSwEqTYfGWFIIwod9Z9aScTcMmhBdSpBfD+viLFES4gbTbbK9nc8ui9zRzy0/TKX50bTj5DhH3HC61T8V5da8XDW5Jax35pASzV06QwA=; X-UUID: 8b5e13835c72421c9fbaf88ad280fa95-20200813 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1833343676; Thu, 13 Aug 2020 23:23:11 -0800 Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 14 Aug 2020 00:13:26 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 14 Aug 2020 15:13:20 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 14 Aug 2020 15:13:19 +0800 From: Xia Jiang To: Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , "Matthias Brugger" , Rick Chang Subject: [PATCH v12 15/29] media: platform: Delete redundant code and add annotation for an enum Date: Fri, 14 Aug 2020 15:11:48 +0800 Message-ID: <20200814071202.25067-17-xia.jiang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200814071202.25067-1-xia.jiang@mediatek.com> References: <20200814071202.25067-1-xia.jiang@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200814_032318_338896_816EF8DD X-CRM114-Status: GOOD ( 15.97 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: maoguang.meng@mediatek.com, devicetree@vger.kernel.org, mojahsu@chromium.org, srv_heupstream@mediatek.com, linux-kernel@vger.kernel.org, Tomasz Figa , senozhatsky@chromium.org, drinkcat@chromium.org, linux-mediatek@lists.infradead.org, Xia Jiang , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Marek Szyprowski Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Signed-off-by: Xia Jiang --- v12: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 15 ++------------- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 8 ++++++-- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c index 980500be027b..db3a8b22dccd 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; } diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h index 4d62438963c0..9b46b0507187 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h @@ -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