mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cpufreq: powernow: Remove redundant 'ret' variable in powernow_decode_bios()
@ 2025-09-03  7:29 Qianfeng Rong
  2025-09-03  7:37 ` Viresh Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Qianfeng Rong @ 2025-09-03  7:29 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, linux-pm, linux-kernel; +Cc: Qianfeng Rong

Remove the unnecessary 'ret' variable from the powernow_decode_bios()
function. It is only used once to store the return value of get_ranges(p)
before immediately returning it. Simplify the code by directly returning
the result of get_ranges(p) instead.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
 drivers/cpufreq/powernow-k7.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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);
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-03  7:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-03  7:29 [PATCH] cpufreq: powernow: Remove redundant 'ret' variable in powernow_decode_bios() Qianfeng Rong
2025-09-03  7:37 ` Viresh Kumar
2025-09-03  7:54   ` Qianfeng Rong
2025-09-03  7:59     ` Viresh Kumar

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®