Re: [PATCH v3 4/8] ACPI: property: Generate camera swnodes for ACPI and DisCo for Imaging

Sakari Ailus
2023-01-30T21:47:03Z

On Mon, Jan 30, 2023 at 11:39:45PM +0200, Andy Shevchenko wrote:
> On Mon, Jan 30, 2023 at 11:22:00PM +0200, Sakari Ailus wrote:
> > On Fri, Jan 27, 2023 at 12:35:12PM +0200, Andy Shevchenko wrote:
> > > On Thu, Jan 26, 2023 at 12:40:57AM +0200, Sakari Ailus wrote:
>
> ...
>
> > > > +static struct fwnode_handle *get_mipi_port_handle(struct acpi_device *device,
> > > > + unsigned int port)
> > > > +{
> > > > + static const char mipi_port_prefix[] = "mipi-img-port-";
> > > > + char mipi_port_name[sizeof(mipi_port_prefix) + 2];
> > >
> > > I think the following will be better:
> > >
> > > char mipi_port_name[16];
> >
> > If the array is too short, this will generate a warning but... this is
> > already handled better than that. Why not to keep it?
>
> We will get the format string self contained.

I have earlier stated as my opinion that it is a lesser concern.

>
> > > > + if (snprintf(mipi_port_name, sizeof(mipi_port_name), "%s%u",
> > > > + mipi_port_prefix, port) >= sizeof(mipi_port_name)) {

--
Sakari Ailus