Thread (56 messages) 56 messages, 5 authors, 2025-02-27

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

From: Zijun Hu <hidden>
Date: 2025-01-14 15:20:58
Also in: lkml

On 2025/1/11 17:17, Krzysztof Kozlowski wrote:
quoted
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).

so perhaps, it is not worthy of a new builtin_strlen().
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help