lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00e1bb24-c2c0-e24b-9852-3b40858859cf@ideasonboard.com>
Date:   Wed, 2 Aug 2023 15:09:29 +0300
From:   Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
To:     Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc:     Jai Luthra <j-luthra@...com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
        Maxime Ripard <mripard@...nel.org>,
        niklas.soderlund+renesas@...natech.se,
        Benoit Parrot <bparrot@...com>,
        Vaishnav Achath <vaishnav.a@...com>,
        Vignesh Raghavendra <vigneshr@...com>, nm@...com,
        devarsht@...com
Subject: Re: [PATCH v8 16/16] media: ti: Add CSI2RX support for J721E

On 02/08/2023 14:14, Sakari Ailus wrote:
> Moi,
> 
> On Wed, Aug 02, 2023 at 02:04:57PM +0300, Tomi Valkeinen wrote:
>>> +static int ti_csi2rx_enum_fmt_vid_cap(struct file *file, void *priv,
>>> +				      struct v4l2_fmtdesc *f)
>>> +{
>>> +	const struct ti_csi2rx_fmt *fmt = NULL;
>>> +
>>> +	if (f->mbus_code) {
>>> +		if (f->index > 0)
>>> +			return -EINVAL;
>>
>> This fails to enumerate the formats if mbus_code is set, doesn't it?
> 
> This is intentional: if the mbus_code field is set, you're supposed to get
> only format(s) corresponding to that mbus code.

Right. But the above code doesn't do that, does it? It will only return 
the first format, and error for anything else. Ah, the driver only 
supports a single mbus code per fourcc. In that case it's ok.

  Tomi

>>
>>> +
>>> +		fmt = find_format_by_code(f->mbus_code);
>>> +	} else {
>>> +		if (f->index >= num_formats)
>>> +			return -EINVAL;
>>> +
>>> +		fmt = &formats[f->index];
>>> +	}
>>> +
>>> +	if (!fmt)
>>> +		return -EINVAL;
>>> +
>>> +	f->pixelformat = fmt->fourcc;
>>> +	memset(f->reserved, 0, sizeof(f->reserved));
>>> +	f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
>>> +
>>> +	return 0;
>>> +}
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ