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-next>] [day] [month] [year] [list]
Message-Id: <20250902114545.651661-1-rongqianfeng@vivo.com>
Date: Tue,  2 Sep 2025 19:45:41 +0800
From: Qianfeng Rong <rongqianfeng@...o.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>,
	Viresh Kumar <viresh.kumar@...aro.org>,
	linux-pm@...r.kernel.org (open list:CPU FREQUENCY SCALING FRAMEWORK),
	linux-kernel@...r.kernel.org (open list)
Cc: Qianfeng Rong <rongqianfeng@...o.com>
Subject: [PATCH v3 0/3] cpufreq: Use int type to store negative error codes

The 'ret' variable usually is used to store returns from some functions,
which return either zero on success or negative error codes on failure.

Storing the negative error codes in unsigned type, doesn't cause an issue
at runtime but can be confusing.  Additionally, assigning negative error
codes to unsigned type may trigger a GCC warning when the -Wsign-conversion
flag is enabled.

Change "ret" from unsigned int to int type.  No effect on runtime.

Signed-off-by: Qianfeng Rong <rongqianfeng@...o.com>
---
Change in v2:
- Modified commit message.

Changes in v3:
- Split each driver into a separate patch.
- In drivers/cpufreq/powernow-k7.c, remove the 'unsigned int ret' variable
  from the powernow_decode_bios() function; since it is only used in one
  place, this simplifies the code.
---
Qianfeng Rong (3):
  cpufreq: Use int type to store negative error codes
  cpufreq: powernow: Use int type to store negative error codes
  cpufreq: speedstep-lib: Use int type to store negative error codes

 drivers/cpufreq/cpufreq.c       |  2 +-
 drivers/cpufreq/powernow-k7.c   |  4 +---
 drivers/cpufreq/speedstep-lib.c | 12 ++++++------
 drivers/cpufreq/speedstep-lib.h | 10 +++++-----
 4 files changed, 13 insertions(+), 15 deletions(-)

-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ