From patchwork Mon Feb 15 04:26:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 383120 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 751C0C433E0 for ; Mon, 15 Feb 2021 04:32:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3755B64E52 for ; Mon, 15 Feb 2021 04:32:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229917AbhBOEce (ORCPT ); Sun, 14 Feb 2021 23:32:34 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:45636 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229908AbhBOEca (ORCPT ); Sun, 14 Feb 2021 23:32:30 -0500 Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0B0B21925; Mon, 15 Feb 2021 05:28:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613363306; bh=CRSJ7I6oVEzCZZz+N3YN8NWPVFaNEl07mkr7p7lhhkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qKU7jUPiwMgTIugK3qACaQXvpKTJxknPnMa9QTfl212FlbfhrzbNNPFptX7K97NSC xgZq0e9zLwfSuYiMreLhdj3FK/gdefAIT1K5il3rcU9by4vcBiTlbJ+zlY02RKvph5 FBwzLZMVnCGDFOX5Au6H7GrpMSXUGGOKWyTSHpYo= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Rui Miguel Silva , Steve Longerbeam , Philipp Zabel , Ezequiel Garcia , Fabio Estevam Subject: [PATCH v2 21/77] media: imx: capture: Remove unneeded variable in __capture_legacy_try_fmt Date: Mon, 15 Feb 2021 06:26:45 +0200 Message-Id: <20210215042741.28850-22-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210215042741.28850-1-laurent.pinchart@ideasonboard.com> References: <20210215042741.28850-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The __capture_legacy_try_fmt() function doesn't need two imx_media_pixfmt pointer variables. Remove one of them. Signed-off-by: Laurent Pinchart Reviewed-by: Rui Miguel Silva Reviewed-by: Steve Longerbeam --- drivers/staging/media/imx/imx-media-capture.c | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index d782394f6cd1..1ef358eb3bd8 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -236,16 +236,16 @@ static int __capture_legacy_try_fmt(struct capture_priv *priv, const struct imx_media_pixfmt **retcc, struct v4l2_rect *compose) { - const struct imx_media_pixfmt *cc, *cc_src; + const struct imx_media_pixfmt *cc; - cc_src = imx_media_find_ipu_format(fmt_src->format.code, - PIXFMT_SEL_YUV_RGB); - if (cc_src) { + cc = imx_media_find_ipu_format(fmt_src->format.code, + PIXFMT_SEL_YUV_RGB); + if (cc) { enum imx_pixfmt_sel fmt_sel; u32 fourcc; - fmt_sel = (cc_src->cs == IPUV3_COLORSPACE_YUV) ? - PIXFMT_SEL_YUV : PIXFMT_SEL_RGB; + fmt_sel = (cc->cs == IPUV3_COLORSPACE_YUV) + ? PIXFMT_SEL_YUV : PIXFMT_SEL_RGB; fourcc = f->fmt.pix.pixelformat; cc = imx_media_find_pixel_format(fourcc, fmt_sel); @@ -254,12 +254,10 @@ static int __capture_legacy_try_fmt(struct capture_priv *priv, cc = imx_media_find_pixel_format(fourcc, fmt_sel); } } else { - cc_src = imx_media_find_mbus_format(fmt_src->format.code, - PIXFMT_SEL_ANY); - if (WARN_ON(!cc_src)) + cc = imx_media_find_mbus_format(fmt_src->format.code, + PIXFMT_SEL_ANY); + if (WARN_ON(!cc)) return -EINVAL; - - cc = cc_src; } /* allow IDMAC interweave but enforce field order from source */