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]

 



On Thu, Jan 19, 2023 at 03:51:33PM +0000, Sakari Ailus wrote:
> 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:

...

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

Have you tried that? Because the strlen() over const string literals will be
optimized away on compilation time.

> > > +		return;

-- 
With Best Regards,
Andy Shevchenko





[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