From: Qianfeng Rong <rongqianfeng@vivo.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq: Use int type to store negative error codes
Date: Sat, 30 Aug 2025 15:32:24 +0800 [thread overview]
Message-ID: <d63b38bb-47d4-4f85-b83c-098bab83f8d2@vivo.com> (raw)
In-Reply-To: <CAJZ5v0jZ+4Ze2t8pw1MPUqzFYFr7g7h6Y-f=gwsmUgbvSThYGg@mail.gmail.com>
在 2025/8/30 0:52, Rafael J. Wysocki 写道:
> On Fri, Aug 29, 2025 at 10:44 AM Qianfeng Rong <rongqianfeng@vivo.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
prev parent reply other threads:[~2025-08-30 7:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 8:44 Qianfeng Rong
2025-08-29 16:52 ` Rafael J. Wysocki
2025-08-30 7:32 ` Qianfeng Rong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d63b38bb-47d4-4f85-b83c-098bab83f8d2@vivo.com \
--to=rongqianfeng@vivo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®