Re: [PATCH v4 2/8] ACPI: property: Parse _CRS CSI-2 descriptor

Sakari Ailus
2023-02-08T20:26:13Z

Hi Andy,

Thanks for the review.

On Wed, Feb 08, 2023 at 06:43:36PM +0200, Andy Shevchenko wrote:
> On Wed, Feb 08, 2023 at 05:28:01PM +0200, Sakari Ailus wrote:
> > Parse newly added ACPI _CRS CSI-2 descriptor for CSI-2 and camera
> > configuration. For now, only figure out where the descriptor is present in
> > order to allow adding information from it to related devices.
>
> Nit-picks below that may be ignored. Up to you, guys.
>
> ...
>
> > +#define NO_CSI2_PORT (~1U)
>
> A bit unclear why this value. Is it bitfield? Then GENMASK() would be better.
> Is it a plain value with a type limit? Then (UINT_MAX - 1) probably the best.

This value is used to signify that a port node isn't yet allocated for a
CSI-2 port. I can change this to UINT_MAX - 1.

>
> ...
>
> > + ads->nodeptrs = (void *)(ads->nodes +
> > + ports_count * 2 + 1);
>
> Now this fits one line.

Yes.

>
> ...
>
> > + handle_refs = kcalloc(csi2_all.handle_count + 1, sizeof(*handle_refs),
> > + GFP_KERNEL);
> > + if (!handle_refs) {
> > + acpi_handle_debug(handle, "no memory for %zu handle refs\n",
> > + csi2_all.handle_count + 1);
> > + return;
> > + }
>
> In a code above you used "1 + foo" approach if I'm not mistaken. Why here is
> the difference?

The last entry is a guardian (NULL handle). 1 + number of lanes is used
where the first lane is the clock lane.

>
> ...
>
> In some code comments which I removed before remarking you forgot the
> grammatical period.

Some comments aren't proper sentences. I'll see which could be improved by
adding a period.

--
Regards,

Sakari Ailus