lkml.org 
[lkml]   [2020]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5.10 527/717] media: ipu3-cio2: Validate mbus format in setting subdev format
On Wed, Dec 30, 2020 at 02:32:46PM +0200, Andy Shevchenko wrote:
> On Wed, Dec 30, 2020 at 2:25 PM Pavel Machek wrote:
>
> > > commit a86cf9b29e8b12811cf53c4970eefe0c1d290476 upstream.
> > >
> > > Validate media bus code, width and height when setting the subdev format.
> > >
> > > This effectively reworks how setting subdev format is implemented in the
> > > driver.
> >
> > Something is wrong here:
> >
> > > + fmt->format.code = formats[0].mbus_code;
> > > + for (i = 0; i < ARRAY_SIZE(formats); i++) {
>
> Looks like 'i = 1' should be...
>
> > > + if (formats[i].mbus_code == fmt->format.code) {

More likely

if (formats[i].mbus_code == mbus_code) {

I think.

Pavel, would you like to submit a patch ?

> > > + fmt->format.code = mbus_code;
> > > + break;
> > > + }
> >
> > This does not make sense. Loop will always exit during the first
> > iteration, making the whole loop crazy/redundant.

--
Regards,

Laurent Pinchart

\
 
 \ /
  Last update: 2020-12-30 13:46    [W:2.051 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site