Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10511108pxu; Wed, 30 Dec 2020 04:59:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxcotahQ3KhE81dGvrBsiaiH0khyIx6J8L1OpfbL9vGB50IyFOYBtXmkJb0tE9WYDUfl+uW X-Received: by 2002:a17:906:f905:: with SMTP id lc5mr49274602ejb.177.1609333150861; Wed, 30 Dec 2020 04:59:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609333150; cv=none; d=google.com; s=arc-20160816; b=ib0c9NVNAbUMfG+tdrVebK4cAC0cBVqtnIRYZvfN/1c9iNQ77KgPb+MWKE+fLrSU5K fFrPjp3GFNYG1XnPO0oiBRH3dSTRqw38TQSXEvZWiGCRDzopnfKvOW8WnhFiqmhJcAKr bPc3Re+rdyfKpK5pG4KPkFyKO0lml//ebZh9Mp9sP4dNAUO+rxIpr8Yh03pfYLB7f4XZ KqWNPpewxvGWgP0QDfl0K4cjjkk1zIjUViuq2NPv6RB+lHMhJvYA2vtA3lzcRK2X7yjD +Q3Pg6cZKgmf0PQEZ0ADjByQvl2O6/2NFKgiGnIFz5/ao7zCRJ30rSDXEvcgeVBSrhte PrWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:to:from:date; bh=yecvZbjnCgUDQ2Y2gmCONaocQuixB36HYjz/q8NPykM=; b=C2MiisqLI6K9oPBy/T3O55U6V/Alvi7rzjupFMQ3kU9Bqs797IHboQyACmmm7W9jvq FcwHawN2nyZUxHoqfMtm2xkx0aRS0rI+wK8SmsCIvSU+FNF1gxJzxPXtj4/5QNGstUpC ML5r8+iZFDN/LXzuh4k6mSKfdhEGrOMYxvYf860CyKgIGGrugEI268L+NfhC+onH2e5k 9C04NdMfAoQ9GVUSpZwED/HCy5JRobJu+lHWTQfzzT7A3Jzl073DFzV1bEYJNwjAG9BE +9V2ihinzRn/nxl76oPMJY5ovGeXSYpIrBbrFUmyasyP8vPtHiU372stYVMOB7coeKlG eNrg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e19si23821560edv.458.2020.12.30.04.58.48; Wed, 30 Dec 2020 04:59:10 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726810AbgL3M4t (ORCPT + 99 others); Wed, 30 Dec 2020 07:56:49 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:33746 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbgL3M4t (ORCPT ); Wed, 30 Dec 2020 07:56:49 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id E78431C0B85; Wed, 30 Dec 2020 13:55:50 +0100 (CET) Date: Wed, 30 Dec 2020 13:55:50 +0100 From: Pavel Machek To: sakari.ailus@linux.intel.com, andy.shevchenko@gmail.com, laurent.pinchart@ideasonboard.com, mchehab+huawei@kernel.org, yong.zhi@intel.com, bingbu.cao@intel.com, tian.shu.qiu@intel.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: ipu3-cio2: Fix mbus_code processing in cio2_subdev_set_fmt() Message-ID: <20201230125550.GA14074@duo.ucw.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Loop was useless as it would always exit on the first iteration. Fix it with right condition.=20 Signed-off-by: Pavel Machek (CIP) Fixes: a86cf9b29e8b ("media: ipu3-cio2: Validate mbus format in setting sub= dev format") index 36e354ecf71e..e8ea69d30bfd 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c @@ -1269,7 +1269,7 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd, fmt->format.code =3D formats[0].mbus_code; =20 for (i =3D 0; i < ARRAY_SIZE(formats); i++) { - if (formats[i].mbus_code =3D=3D fmt->format.code) { + if (formats[i].mbus_code =3D=3D mbus_code) { fmt->format.code =3D mbus_code; break; } --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --LZvS9be/3tNcYl/X Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCX+x41gAKCRAw5/Bqldv6 8i+mAKCHsIm46MSL3YqNC9y2aZBbqUsRUwCcD1mOTaJgCn1SCO8EItO+i7PduYc= =Rvsp -----END PGP SIGNATURE----- --LZvS9be/3tNcYl/X--