Skip to contentSkip to conversation

cpufreq: intel_pstate: remove obsolete functions

PATCH Applied Lukas Bulwahn 3 participants 3 messages Dec 21, 2020 – Jan 7, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: intel_pstate: remove obsolete functions

percent_fp() was used in intel_pstate_pid_reset(), which was removed in commit 9d0ef7af1f2d ("cpufreq: intel_pstate: Do not use PID-based P-state selection") and hence, percent_fp() is unused since then.

percent_ext_fp() was last used in intel_pstate_update_perf_limits(), which was refactored in commit 1a4fe38add8b ("cpufreq: intel_pstate: Remove max/min fractions to limit performance"), and hence, percent_ext_fp() is unused since then.

make CC=clang W=1 points us those unused functions:

drivers/cpufreq/intel_pstate.c:79:23: warning: unused function 'percent_fp' [-Wunused-function] static inline int32_t percent_fp(int percent)

                      ^

drivers/cpufreq/intel_pstate.c:94:23: warning: unused function 'percent_ext_fp' [-Wunused-function] static inline int32_t percent_ext_fp(int percent)

                      ^

Remove those obsolete functions.

---
applies cleanly on current master and next-20201221

Srinivas, Len, Rafael, Viresh, please pick this minor non-urgent cleanup patch.

 drivers/cpufreq/intel_pstate.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/cpufreq/intel_pstate.c +0 -10
index 2a4db856222f..0e35dd247986 100644
@@ -76,11 +76,6 @@ static inline int ceiling_fp(int32_t x)
 	return ret;
 }
 
-static inline int32_t percent_fp(int percent)
-{
-	return div_fp(percent, 100);
-}
-
 static inline u64 mul_ext_fp(u64 x, u64 y)
 {
 	return (x * y) >> EXT_FRAC_BITS;
@@ -91,11 +86,6 @@ static inline u64 div_ext_fp(u64 x, u64 y)
 	return div64_u64(x << EXT_FRAC_BITS, y);
 }
 
-static inline int32_t percent_ext_fp(int percent)
-{
-	return div_ext_fp(percent, 100);
-}
-
 /**
  * struct sample -	Store performance sample
  * @core_avg_perf:	Ratio of APERF/MPERF which is the actual average
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Lukas Bulwahn

percent_fp() was used in intel_pstate_pid_reset(), which was removed in commit 9d0ef7af1f2d ("cpufreq: intel_pstate: Do not use PID-based P-state selection") and hence, percent_fp() is unused since then.

percent_ext_fp() was last used in intel_pstate_update_perf_limits(), which was refactored in commit 1a4fe38add8b ("cpufreq: intel_pstate: Remove max/min fractions to limit performance"), and hence, percent_ext_fp() is unused since then.

make CC=clang W=1 points us those unused functions:

drivers/cpufreq/intel_pstate.c:79:23: warning: unused function 'percent_fp' [-Wunused-function] static inline int32_t percent_fp(int percent)

                      ^
Quoted 7 lines

drivers/cpufreq/intel_pstate.c:94:23: warning: unused function 'percent_ext_fp' [-Wunused-function] static inline int32_t percent_ext_fp(int percent)

                      ^

Remove those obsolete functions.

Quoted 39 lines

---
applies cleanly on current master and next-20201221

Srinivas, Len, Rafael, Viresh, please pick this minor non-urgent cleanup patch.

 drivers/cpufreq/intel_pstate.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/cpufreq/intel_pstate.c +0 -10
index 2a4db856222f..0e35dd247986 100644
@@ -76,11 +76,6 @@ static inline int ceiling_fp(int32_t x)
 	return ret;
 }
 
-static inline int32_t percent_fp(int percent)
-{
-	return div_fp(percent, 100);
-}
-
 static inline u64 mul_ext_fp(u64 x, u64 y)
 {
 	return (x * y) >> EXT_FRAC_BITS;
@@ -91,11 +86,6 @@ static inline u64 div_ext_fp(u64 x, u64 y)
 	return div64_u64(x << EXT_FRAC_BITS, y);
 }
 
-static inline int32_t percent_ext_fp(int percent)
-{
-	return div_ext_fp(percent, 100);
-}
-
 /**
  * struct sample -	Store performance sample
  * @core_avg_perf:	Ratio of APERF/MPERF which is the actual average
Signature · 1 line
2.17.1
maintainer Applied
#2 lore raw
Quoted 55 lines · Nathan Chancellor
Quoted 15 lines · Lukas Bulwahn

percent_fp() was used in intel_pstate_pid_reset(), which was removed in commit 9d0ef7af1f2d ("cpufreq: intel_pstate: Do not use PID-based P-state selection") and hence, percent_fp() is unused since then.

percent_ext_fp() was last used in intel_pstate_update_perf_limits(), which was refactored in commit 1a4fe38add8b ("cpufreq: intel_pstate: Remove max/min fractions to limit performance"), and hence, percent_ext_fp() is unused since then.

make CC=clang W=1 points us those unused functions:

drivers/cpufreq/intel_pstate.c:79:23: warning: unused function 'percent_fp' [-Wunused-function] static inline int32_t percent_fp(int percent)

                      ^
Quoted 7 lines

drivers/cpufreq/intel_pstate.c:94:23: warning: unused function 'percent_ext_fp' [-Wunused-function] static inline int32_t percent_ext_fp(int percent)

                      ^

Remove those obsolete functions.

Quoted 28 lines

---
applies cleanly on current master and next-20201221

Srinivas, Len, Rafael, Viresh, please pick this minor non-urgent cleanup patch.

 drivers/cpufreq/intel_pstate.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/cpufreq/intel_pstate.c +0 -5
index 2a4db856222f..0e35dd247986 100644
@@ -76,11 +76,6 @@ static inline int ceiling_fp(int32_t x)
      return ret;
 }
 
-static inline int32_t percent_fp(int percent)
-{
-     return div_fp(percent, 100);
-}
-
 static inline u64 mul_ext_fp(u64 x, u64 y)
 {
      return (x * y) >> EXT_FRAC_BITS;
@@ -91,11 +86,6 @@ static inline u64 div_ext_fp(u64 x, u64 y)
      return div64_u64(x << EXT_FRAC_BITS, y);
 }
 
Quoted 9 lines

drivers/cpufreq/intel_pstate.c static inline u64 div_ext_fp(u64 x, u64 y)

Quoted 9 lines
drivers/cpufreq/intel_pstate.c +0 -6
-static inline int32_t percent_ext_fp(int percent)
-{
-     return div_ext_fp(percent, 100);
-}
-
 /**
  * struct sample -   Store performance sample
  * @core_avg_perf:   Ratio of APERF/MPERF which is the actual average
--

Applied as 5.11-rc material, thanks!