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: <d63b38bb-47d4-4f85-b83c-098bab83f8d2@vivo.com>
Date: Sat, 30 Aug 2025 15:32:24 +0800
From: Qianfeng Rong <rongqianfeng@...o.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Viresh Kumar <viresh.kumar@...aro.org>, linux-pm@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cpufreq: Use int type to store negative error codes


在 2025/8/30 0:52, Rafael J. Wysocki 写道:
> On Fri, Aug 29, 2025 at 10:44 AM Qianfeng Rong <rongqianfeng@...o.com> wrote:
>> Change the 'ret' variable from unsigned int to int to store negative error
>> codes directly or returned by other functions.
> You need to say upfront that this is about speedstep_get_freqs() specifically.


Yes, my commit message was a little unclear. I will improve it.


>
>> Change the return type of
>> the speedstep_get_freqs() function from unsigned int to int as well.
>>
>> Storing the negative error codes in unsigned type, doesn't cause an issue
>> at runtime but it's ugly as pants.
> Which isn't really a technical term.


Yes, I should have used more normal words.


>
>> Additionally, assigning negative error codes to unsigned type may trigger a GCC warning
>> when the -Wsign-conversion flag is enabled.
> Is the latter a motivation for this change?


That's one aspect. On the other hand, I think code that assigns negative
values to an unsigned type is confusing, so I want to fix such code.

Best regards, Qianfeng


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ