Re: [PATCH 1/1] device property: Add fwnode_name_eq()

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

 



On Tue, Oct 31, 2023 at 03:53:06PM +0200, Sakari Ailus wrote:
> Add fwnode_name_eq() to implement the functionality of of_node_name_eq()
> on fwnode property API. The same convention of ending the comparison at
> '@' (besides '\0') is applied on also both ACPI and swnode. The function
> is intended for comparing unit address-less node names on DT and firmware
> or swnodes compliant with DT bindings.

Some comments below.

...

> Would you be able to use this to replace of_node_name_eq()?

Can you point out to the use case? Maybe it can be rewritten using existing
APIs?

...

> +	len = strchrnul(node_name, '@') - node_name;

> +	return strlen(name) == len && !strncmp(node_name, name, len);

Seems like this is reimplementation of str_has_prefix().

	len = strchrnul(node_name, '@') - node_name;
	return str_has_prefix(node_name, name) == len;

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux