lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55a2e1cc-0a34-4599-8d62-a2479a0eac87@icloud.com>
Date: Tue, 14 Jan 2025 23:20:45 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Krzysztof Kozlowski <krzk@...nel.org>
Cc: Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>,
 Maxime Ripard <mripard@...nel.org>, Robin Murphy <robin.murphy@....com>,
 Grant Likely <grant.likely@...retlab.ca>, Marc Zyngier <maz@...nel.org>,
 Andreas Herrmann <andreas.herrmann@...xeda.com>,
 Marek Szyprowski <m.szyprowski@...sung.com>,
 Catalin Marinas <catalin.marinas@....com>, Mike Rapoport <rppt@...nel.org>,
 Oreoluwa Babatunde <quic_obabatun@...cinc.com>, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org, Zijun Hu <quic_zijuhu@...cinc.com>
Subject: Re: [PATCH v4 14/14] of: Improve __of_add_property_sysfs()
 readability

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ