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] [day] [month] [year] [list]
Message-ID: <2159c5bf-1ce3-4fd7-81e3-f458efca8548@icloud.com>
Date: Thu, 4 Sep 2025 07:00:37 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Danilo Krummrich <dakr@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Dave Ertman <david.m.ertman@...el.com>, Ira Weiny <ira.weiny@...el.com>,
 Leon Romanovsky <leon@...nel.org>, "Rafael J. Wysocki" <rafael@...nel.org>,
 linux-kernel@...r.kernel.org, Zijun Hu <zijun.hu@....qualcomm.com>
Subject: Re: [PATCH v2] driver core: auxiliary bus: Optimize logic of
 auxiliary_match_id()

On 2025/9/3 19:46, Danilo Krummrich wrote:
>>  static const struct auxiliary_device_id *auxiliary_match_id(const struct auxiliary_device_id *id,
>>  							    const struct auxiliary_device *auxdev)
>>  {
>> -	for (; id->name[0]; id++) {
>> -		const char *p = strrchr(dev_name(&auxdev->dev), '.');
>> -		int match_size;
>> +	const char *auxdev_name = dev_name(&auxdev->dev);
> I feel like this is a bit too ambitious. Using dev_name() directly for the calls
> below seems more obvious to me.
> 

dev_name(&auxdev->dev) which is a inline function appears 3 times in the
for loop. may be worthy of a new variable


> Yes, dev_name() contains a branch, but I'm pretty sure the compiler optimizes
> them away for subsequent calls anyways.

>From debugging perspective:
more difficult to debug if more the compiler optimizes.




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ