Re: [PATCH 7/8] ACPI: property: Skip MIPI property table without "mipi-img" prefix

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

 



Hi Andy,

On Tue, Jan 17, 2023 at 05:29:54PM +0200, Andy Shevchenko wrote:
> On Tue, Jan 17, 2023 at 02:22:43PM +0200, Sakari Ailus wrote:
> > For all _DSD properties, skip going through the MIPI DisCo for Imaging
> > property name substitution table if the property doesn't have "mipi-img-"
> > prefix.
> 
> ...
> 
> > +#define MIPI_IMG_PREFIX "mipi-img-"
> 
> I don't think this is good for readability.

It should be used at least below, where it is referred twice.

I'm open to removing this from the table though.

> 
> ...
> 
> > +	if (memcmp(elements[0].string.pointer, MIPI_IMG_PREFIX,
> > +		   sizeof(MIPI_IMG_PREFIX) - 1))
> 
> str_has_prefix()

str_has_prefix() calls strlen() on prefix on every call. sizeof() will
generate much less code --- it's just a number.

> 
> > +		return;

-- 
Regards,

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