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: <993a2758-3756-48e6-a18a-ebb13a5ff41c@vivo.com>
Date: Mon, 1 Sep 2025 19:51:35 +0800
From: Qianfeng Rong <rongqianfeng@...o.com>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, linux-pm@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] cpufreq: Use int type to store negative error codes


在 2025/9/1 14:08, Viresh Kumar 写道:
> On 30-08-25, 17:34, Qianfeng Rong wrote:
>>   drivers/cpufreq/cpufreq.c       |  2 +-
>>   drivers/cpufreq/powernow-k7.c   |  2 +-
>>   drivers/cpufreq/speedstep-lib.c | 12 ++++++------
>>   drivers/cpufreq/speedstep-lib.h | 10 +++++-----
> This should really be three different patches instead.


I will try to do this in the next version.


>
>>   4 files changed, 13 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
>> index a615c98d80ca..f47096683abb 100644
>> --- a/drivers/cpufreq/cpufreq.c
>> +++ b/drivers/cpufreq/cpufreq.c
>> @@ -914,7 +914,7 @@ static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy,
>>   					const char *buf, size_t count)
>>   {
>>   	unsigned int freq = 0;
>> -	unsigned int ret;
>> +	int ret;
>>   
>>   	if (!policy->governor || !policy->governor->store_setspeed)
>>   		return -EINVAL;
>> diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c
>> index 31039330a3ba..88616cd14353 100644
>> --- a/drivers/cpufreq/powernow-k7.c
>> +++ b/drivers/cpufreq/powernow-k7.c
>> @@ -451,7 +451,7 @@ static int powernow_decode_bios(int maxfid, int startvid)
>>   	unsigned int i, j;
>>   	unsigned char *p;
>>   	unsigned int etuple;
>> -	unsigned int ret;
>> +	int ret;
> I would rather do this instead:
>
> diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c
> index 31039330a3ba..72430c3c5500 100644
> --- a/drivers/cpufreq/powernow-k7.c
> +++ b/drivers/cpufreq/powernow-k7.c
> @@ -451,7 +451,6 @@ static int powernow_decode_bios(int maxfid, int startvid)
>          unsigned int i, j;
>          unsigned char *p;
>          unsigned int etuple;
> -       unsigned int ret;
>
>          etuple = cpuid_eax(0x80000001);
>
> @@ -500,8 +499,7 @@ static int powernow_decode_bios(int maxfid, int startvid)
>                                      (startvid == pst->startvid)) {
>                                          print_pst_entry(pst, j);
>                                          p = (char *)pst + sizeof(*pst);
> -                                       ret = get_ranges(p);
> -                                       return ret;
> +                                       return get_ranges(p);
>                                  } else {
>                                          unsigned int k;
>                                          p = (char *)pst + sizeof(*pst);

Exactly, this looks much better, and I’ll incorporate it into the V2 
version.

Best regards,
Qianfeng


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ