Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1523596ybk; Thu, 21 May 2020 08:52:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydc4UNCvebYLuykJo0yuoNbfeV0vwRxpG70y/KI7B1LTvYHE0Sq7pNTxYD7eapDLwpqyiY X-Received: by 2002:a50:955a:: with SMTP id v26mr8308351eda.5.1590076326819; Thu, 21 May 2020 08:52:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590076326; cv=none; d=google.com; s=arc-20160816; b=trGaatOak2cmoE5p2OF8Hq8z+0ok26h6vFOURtrdkJyQfz4a0e/qKhbDItHAv8A/n9 CUimDceBD4DXVi4rl2zvK2SnI0iVQE/i4zDBnfLrHz6+y1vyAGqh3r40eIceinhlpTI8 6WtmCSewznkcvEbdmaK2QuVlXtgL52uEvQQUOTsiKSImCIjizYS1HCx72tfdumpairnZ T2+f1ari7/0ElBwuurfEfqWeB0yMa53lGcd/24ZiL0iKcvwpK+P3GBfJMpWwQMsG5leG gORxqzu3/FAALXaPoUacA3VQM/+oXmY37ygwZgRzE48V7nuDe2cYZz4/zz4bdDFHrSWd 2e0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=I5QXaX52IPaG+95gPfmlZ0rD63JTAUJslTJmrnwNjQc=; b=LNB0OIdLwmr+72U/oCSvnDcscVnTy1VZyOyG+So8NZn+oilyZyZFb4AnnFOvv1cuov sLu6kq11iA0/9fLv+QHs6fdPuVsdgNNNkRZeUH5TeNkubhOlXkCuIgHClFrv1FUwj9B8 nUgGgHLjvMZRU2pcMryk+F0f5UXwyE7Bd88XkSxcdRvI18RX90qtcBXJo1S6SazMczDF zkvYwXvGP3nG5KQPFAxTtmbENumg5RlQsfpbuT8e/Zm3LvnhW8BXSIcsdLII/AAgbEKr XBja5if6chGGQEld3t2Unt839TQIfVDt20aWG7XxJmCqlJAE4Vh+8tDLsXSh6/4BDuYc IJ+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ID1dvrYm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr11si2822728ejb.602.2020.05.21.08.51.43; Thu, 21 May 2020 08:52:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ID1dvrYm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728226AbgEUPuE (ORCPT + 99 others); Thu, 21 May 2020 11:50:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726814AbgEUPuD (ORCPT ); Thu, 21 May 2020 11:50:03 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E07CC061A0E for ; Thu, 21 May 2020 08:50:02 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id x14so1746210wrp.2 for ; Thu, 21 May 2020 08:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=I5QXaX52IPaG+95gPfmlZ0rD63JTAUJslTJmrnwNjQc=; b=ID1dvrYmYK5R1R7a0Cw6H9ckAbwIgzD1jEh8cLijWGS6z4cOVQD8npfgacuW3YzbTR 6p53ASb2F8xqyBMI8KhptHeaQt1pyG6j16NzI19RwIF22j7IKpB1vdhv2vKICxvPmIGS L9IwRDjpD8PgKAcggZu7EgMhLsHQK5hYnPirU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=I5QXaX52IPaG+95gPfmlZ0rD63JTAUJslTJmrnwNjQc=; b=Xe/hf71Ky/xHkSg7dVUqas/OUis3C/k5EJJQ2JLy80G6/Y91Sm/Dtng9ugbw9lAVlj gnQGrYXrUQ8W++ULDGLcCTuwY1cMoARYXQAPDsOo0IWyvt2/szZkPIDbZWtekZ31uVlJ n8yWUmsaluThhuGa3DkpvWl4J5OgR+e+Afbq5NAl5XeVrSjuA7hN85vsl2KRgxyhFLrz RscjghJa1cXJtFiP+eP8gIlIaD6QJ7F8r23UVza2OHToxm7DIquqh0NLMwvDack02BBK N3po1V2ZOs64QrMKRrAu17r2F3Xhu7i2GzOH0Rce4Yvm2RjGpU6H5vOmfNpvG+9H0wj7 9CmQ== X-Gm-Message-State: AOAM5316tU5Gpne1i7N95V3tEC++c4Yu9Hqi7jlF9F5gP53NK9xOuu+B 2iZZ+187tTAbgj+IitC7y5fHqg== X-Received: by 2002:adf:ec87:: with SMTP id z7mr9942589wrn.149.1590076200716; Thu, 21 May 2020 08:50:00 -0700 (PDT) Received: from chromium.org (205.215.190.35.bc.googleusercontent.com. [35.190.215.205]) by smtp.gmail.com with ESMTPSA id r3sm6663037wmh.48.2020.05.21.08.50.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 08:50:00 -0700 (PDT) Date: Thu, 21 May 2020 15:49:58 +0000 From: Tomasz Figa To: Xia Jiang Cc: Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Rick Chang , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Marek Szyprowski , srv_heupstream@mediatek.com, senozhatsky@chromium.org, mojahsu@chromium.org, drinkcat@chromium.org, maoguang.meng@mediatek.com, sj.huang@mediatek.com Subject: Re: [PATCH v8 10/14] media: platform: Delete redundant code for improving code quality Message-ID: <20200521154958.GI209565@chromium.org> References: <20200403094033.8288-1-xia.jiang@mediatek.com> <20200403094033.8288-11-xia.jiang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200403094033.8288-11-xia.jiang@mediatek.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Xia, On Fri, Apr 03, 2020 at 05:40:29PM +0800, Xia Jiang wrote: > 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(-) > Thank you for the patch. Please see my comments inline. > 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)); This change is not mentioned in the description. I'd suggest moving it to a separate patch, because it's a functional change. > 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 typo: s/contex/context/ But I'd rephrase it to "states of the context state machine". > + */ Not mentioned in the description. Also, the documentation of an enum should have descriptions for the values. Best regards, Tomasz