Commit c98e247
committed
thermal: gov_fair_share: Eliminate unnecessary integer divisions
The computations carried out by fair_share_throttle() for each trip
point include at least one redundant integer division which introduces
superfluous rounding errors. Also the multiplications by 100 in it are
not really necessary and can be eliminated.
Rearrange fair_share_throttle() to carry out only one integer division per
trip and only as many integer multiplications as necessary and rename one
variable in it (while at it).
Signed-off-by: Rafael J. Wysocki <[email protected]>
Reviewed-by: Lukasz Luba <[email protected]>1 parent 0292991 commit c98e247
File tree
1 file changed
+15
-17
lines changed- drivers/thermal
1 file changed
+15
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 44 | | |
51 | 45 | | |
52 | 46 | | |
| |||
58 | 52 | | |
59 | 53 | | |
60 | 54 | | |
61 | | - | |
| 55 | + | |
62 | 56 | | |
63 | 57 | | |
64 | 58 | | |
| |||
72 | 66 | | |
73 | 67 | | |
74 | 68 | | |
75 | | - | |
| 69 | + | |
76 | 70 | | |
77 | 71 | | |
78 | 72 | | |
79 | 73 | | |
80 | 74 | | |
81 | 75 | | |
82 | | - | |
| 76 | + | |
83 | 77 | | |
84 | 78 | | |
85 | 79 | | |
86 | | - | |
87 | 80 | | |
| 81 | + | |
| 82 | + | |
88 | 83 | | |
89 | 84 | | |
90 | 85 | | |
91 | 86 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
99 | 97 | | |
100 | 98 | | |
101 | 99 | | |
| |||
0 commit comments