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:13:38
Also in: lkml

On 2025/1/14 07:46, Rob Herring wrote:
quoted
i understand your concern about performance.

what about below solution ?
See 72921427d46b ("string.h: Add str_has_prefix() helper function"). 

Though we already had strstarts(), but that lacks __always_inline which 
seems is important for eliminating the strlen(). Also, since that 
commit, clang has become more common and need to make sure the same 
optimization happens on it.
than you Rob for sharing with these useful info.

i believe your proposal is feasible to improve  strstarts() performance
to achieve performance level of
strncmp(str, "const", sizeof("const") - 1).


this is a common issue and i would like to start a new thread to discuss
this.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help