Commit 75ac63db authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher

drm/amd/powerplay: fix Smatch static checker warnings with indenting (v2)

v2: AGD: rebase on upstream
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarKen Wang  <Qingqing.Wang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 53d3de14
...@@ -943,6 +943,7 @@ static int fiji_trim_voltage_table(struct pp_hwmgr *hwmgr, ...@@ -943,6 +943,7 @@ static int fiji_trim_voltage_table(struct pp_hwmgr *hwmgr,
return 0; return 0;
} }
static int fiji_get_svi2_mvdd_voltage_table(struct pp_hwmgr *hwmgr, static int fiji_get_svi2_mvdd_voltage_table(struct pp_hwmgr *hwmgr,
phm_ppt_v1_clock_voltage_dependency_table *dep_table) phm_ppt_v1_clock_voltage_dependency_table *dep_table)
{ {
......
...@@ -317,4 +317,3 @@ int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr) ...@@ -317,4 +317,3 @@ int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr)
return 0; return 0;
} }
...@@ -272,7 +272,6 @@ fInt GetScaledFraction(int X, int factor) ...@@ -272,7 +272,6 @@ fInt GetScaledFraction(int X, int factor)
if (factor < 0) { if (factor < 0) {
factor = -1*factor; factor = -1*factor;
bNEGATED = !bNEGATED; /*If bNEGATED = true due to X < 0, this will cover the case of negative cancelling negative */ bNEGATED = !bNEGATED; /*If bNEGATED = true due to X < 0, this will cover the case of negative cancelling negative */
} }
...@@ -413,7 +412,9 @@ fInt fSqrt(fInt num) ...@@ -413,7 +412,9 @@ fInt fSqrt(fInt num)
fInt x_new, x_old, C, y; fInt x_new, x_old, C, y;
fInt fZERO = ConvertToFraction(0); fInt fZERO = ConvertToFraction(0);
/* (0 > num) is the same as (num < 0), i.e., num is negative */ /* (0 > num) is the same as (num < 0), i.e., num is negative */
if (GreaterThan(fZERO, num) || Equal(fZERO, num)) if (GreaterThan(fZERO, num) || Equal(fZERO, num))
return fZERO; return fZERO;
...@@ -461,7 +462,7 @@ fInt fSqrt(fInt num) ...@@ -461,7 +462,7 @@ fInt fSqrt(fInt num)
void SolveQuadracticEqn(fInt A, fInt B, fInt C, fInt Roots[]) void SolveQuadracticEqn(fInt A, fInt B, fInt C, fInt Roots[])
{ {
fInt* pRoots = &Roots[0]; fInt *pRoots = &Roots[0];
fInt temp, root_first, root_second; fInt temp, root_first, root_second;
fInt f_CONSTANT10, f_CONSTANT100; fInt f_CONSTANT10, f_CONSTANT100;
...@@ -521,12 +522,8 @@ int GetRoundedValue(fInt A) /*For now, round the 3rd decimal place */ ...@@ -521,12 +522,8 @@ int GetRoundedValue(fInt A) /*For now, round the 3rd decimal place */
{ {
/* ROUNDING TEMPORARLY DISABLED /* ROUNDING TEMPORARLY DISABLED
int temp = A.full; int temp = A.full;
int decimal_cutoff, decimal_mask = 0x000001FF; int decimal_cutoff, decimal_mask = 0x000001FF;
decimal_cutoff = temp & decimal_mask; decimal_cutoff = temp & decimal_mask;
if (decimal_cutoff > 0x147) { if (decimal_cutoff > 0x147) {
temp += 673; temp += 673;
}*/ }*/
...@@ -545,6 +542,7 @@ fInt Multiply (int X, int Y) ...@@ -545,6 +542,7 @@ fInt Multiply (int X, int Y)
return Product; return Product;
} }
fInt Divide (int X, int Y) fInt Divide (int X, int Y)
{ {
fInt A, B, Quotient; fInt A, B, Quotient;
...@@ -564,11 +562,8 @@ int uGetScaledDecimal (fInt A) /*Converts the fractional portion to whole intege ...@@ -564,11 +562,8 @@ int uGetScaledDecimal (fInt A) /*Converts the fractional portion to whole intege
for (i = 0; i < PRECISION; i++) { for (i = 0; i < PRECISION; i++) {
dec[i] = tmp / (1 << SHIFT_AMOUNT); dec[i] = tmp / (1 << SHIFT_AMOUNT);
tmp = tmp - ((1 << SHIFT_AMOUNT)*dec[i]); tmp = tmp - ((1 << SHIFT_AMOUNT)*dec[i]);
tmp *= 10; tmp *= 10;
scaledDecimal = scaledDecimal + dec[i]*uPow(10, PRECISION - 1 -i); scaledDecimal = scaledDecimal + dec[i]*uPow(10, PRECISION - 1 -i);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment