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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux