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 IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux