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

Andy Shevchenko
2023-02-08T16:44:28Z

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.

...

> + ads->nodeptrs = (void *)(ads->nodes +
> + ports_count * 2 + 1);

Now this fits one line.

...

> + 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?

...

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

--
With Best Regards,
Andy Shevchenko