Re: [PATCH v4 14/14] of: Improve __of_add_property_sysfs() readability

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

 



On 14/01/2025 16:20, Zijun Hu wrote:
> On 2025/1/11 17:17, Krzysztof Kozlowski wrote:
>>> const char security_prefix[] = "security-";
>>> use 'sizeof(security_prefix) - 1' for the length of string.
>> Code is still not equivalent - just de-assemble it and you will see
>> some overhead.
>>
>> Maybe just introduce builtin_strlen() to string.h and use such? It would
>> be the pretty obvious code.
> 
> strncmp(s1, "s2_string", builtin_strlen("s2_string")) is similar as
> strncmp(s1, "s2_string", sizeof("s2_string") - 1).

Above yes, but maybe builtin_strlen() could be made to work on the
pointer, thus you would have "s2_string" in only one place.

> 
> so perhaps, it is not worthy of a new builtin_strlen().

Best regards,
Krzysztof




[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