From patchwork Fri Apr 3 09:40:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xia Jiang X-Patchwork-Id: 202470 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_BASE64_TEXT, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56FBCC43331 for ; Fri, 3 Apr 2020 09:41:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A460208E4 for ; Fri, 3 Apr 2020 09:41:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="MIvGBSw/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403797AbgDCJkx (ORCPT ); Fri, 3 Apr 2020 05:40:53 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:19623 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2403783AbgDCJkx (ORCPT ); Fri, 3 Apr 2020 05:40:53 -0400 X-UUID: 851245fb58ec43c4b7c4fa9c7e4da0c7-20200403 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=Lprj+ufCYbzLwTfc1XoNnGUMFca4BTukbE1k5gVfSdE=; b=MIvGBSw/zhjYjs0qUOTihWrnVV5bXZMhWThnQLXnXpRyTjDrFvEUCC0HmC/kmm1Ak3PtuK1wJ319ypH8StWqr1BU7fTkcjQi22FGB/u1oVImy6ijPaRee0e0FdJ81E2crmNen0qPKhiAj7J6Gwwz9Td1Ts5J6xgyiILYiayG43g=; X-UUID: 851245fb58ec43c4b7c4fa9c7e4da0c7-20200403 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 407350468; Fri, 03 Apr 2020 17:40:47 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 3 Apr 2020 17:40:43 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 3 Apr 2020 17:40:43 +0800 From: Xia Jiang To: Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Rick Chang CC: , , , , , Marek Szyprowski , Tomasz Figa , , , , , , , Xia Jiang Subject: [PATCH v8 10/14] media: platform: Delete redundant code for improving code quality Date: Fri, 3 Apr 2020 17:40:29 +0800 Message-ID: <20200403094033.8288-11-xia.jiang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200403094033.8288-1-xia.jiang@mediatek.com> References: <20200403094033.8288-1-xia.jiang@mediatek.com> MIME-Version: 1.0 X-MTK: N Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Delete unused member variables annotation. Delete unused variable definition. Delete redundant log print, because V4L2 debug logs already print it. Signed-off-by: Xia Jiang --- v8: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 16 ++-------------- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 5 +++-- 2 files changed, 5 insertions(+), 16 deletions(-) -- 2.18.0 diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c index 4e64046a6854..9e59b9a51ef0 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c @@ -182,7 +182,6 @@ 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; memset(pix_mp->reserved, 0, sizeof(pix_mp->reserved)); @@ -190,7 +189,7 @@ static int mtk_jpeg_try_fmt_mplane(struct v4l2_format *f, if (ctx->state != MTK_JPEG_INIT) { mtk_jpeg_adjust_fmt_mplane(ctx, f); - goto end; + return 0; } pix_mp->num_planes = fmt->colplanes; @@ -210,7 +209,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 */ @@ -224,20 +223,9 @@ static int mtk_jpeg_try_fmt_mplane(struct v4l2_format *f, u32 stride = pix_mp->width * fmt->h_sample[i] / 4; u32 h = pix_mp->height * fmt->v_sample[i] / 4; - memset(pfmt->reserved, 0, sizeof(pfmt->reserved)); 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 64a731261214..9bbd615b1067 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h @@ -30,6 +30,9 @@ #define MTK_JPEG_DEFAULT_SIZEIMAGE (1 * 1024 * 1024) +/** + * enum mtk_jpeg_ctx_state - contex state of jpeg + */ enum mtk_jpeg_ctx_state { MTK_JPEG_INIT = 0, MTK_JPEG_RUNNING, @@ -109,9 +112,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