drm/amd/powerplay: Mark functions of ppevvmath.h static

This introduces some warnings due to unused functions, that are
deleted in the following commit.

Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Nils Wallménius 2016-04-24 13:22:30 +02:00 committed by Alex Deucher
parent a37cfa8be2
commit 21039ac388

View File

@ -50,53 +50,53 @@ typedef union _fInt {
* Function Declarations * Function Declarations
* ------------------------------------------------------------------------------- * -------------------------------------------------------------------------------
*/ */
fInt ConvertToFraction(int); /* Use this to convert an INT to a FINT */ static fInt ConvertToFraction(int); /* Use this to convert an INT to a FINT */
fInt Convert_ULONG_ToFraction(uint32_t); /* Use this to convert an uint32_t to a FINT */ static fInt Convert_ULONG_ToFraction(uint32_t); /* Use this to convert an uint32_t to a FINT */
fInt GetScaledFraction(int, int); /* Use this to convert an INT to a FINT after scaling it by a factor */ static fInt GetScaledFraction(int, int); /* Use this to convert an INT to a FINT after scaling it by a factor */
int ConvertBackToInteger(fInt); /* Convert a FINT back to an INT that is scaled by 1000 (i.e. last 3 digits are the decimal digits) */ static int ConvertBackToInteger(fInt); /* Convert a FINT back to an INT that is scaled by 1000 (i.e. last 3 digits are the decimal digits) */
fInt fNegate(fInt); /* Returns -1 * input fInt value */ static fInt fNegate(fInt); /* Returns -1 * input fInt value */
fInt fAdd (fInt, fInt); /* Returns the sum of two fInt numbers */ static fInt fAdd (fInt, fInt); /* Returns the sum of two fInt numbers */
fInt fSubtract (fInt A, fInt B); /* Returns A-B - Sometimes easier than Adding negative numbers */ static fInt fSubtract (fInt A, fInt B); /* Returns A-B - Sometimes easier than Adding negative numbers */
fInt fMultiply (fInt, fInt); /* Returns the product of two fInt numbers */ static fInt fMultiply (fInt, fInt); /* Returns the product of two fInt numbers */
fInt fDivide (fInt A, fInt B); /* Returns A/B */ static fInt fDivide (fInt A, fInt B); /* Returns A/B */
fInt fGetSquare(fInt); /* Returns the square of a fInt number */ static fInt fGetSquare(fInt); /* Returns the square of a fInt number */
fInt fSqrt(fInt); /* Returns the Square Root of a fInt number */ static fInt fSqrt(fInt); /* Returns the Square Root of a fInt number */
int uAbs(int); /* Returns the Absolute value of the Int */ static int uAbs(int); /* Returns the Absolute value of the Int */
fInt fAbs(fInt); /* Returns the Absolute value of the fInt */ static fInt fAbs(fInt); /* Returns the Absolute value of the fInt */
int uPow(int base, int exponent); /* Returns base^exponent an INT */ static int uPow(int base, int exponent); /* Returns base^exponent an INT */
void SolveQuadracticEqn(fInt, fInt, fInt, fInt[]); /* Returns the 2 roots via the array */ static void SolveQuadracticEqn(fInt, fInt, fInt, fInt[]); /* Returns the 2 roots via the array */
bool Equal(fInt, fInt); /* Returns true if two fInts are equal to each other */ static bool Equal(fInt, fInt); /* Returns true if two fInts are equal to each other */
bool GreaterThan(fInt A, fInt B); /* Returns true if A > B */ static bool GreaterThan(fInt A, fInt B); /* Returns true if A > B */
fInt fExponential(fInt exponent); /* Can be used to calculate e^exponent */ static fInt fExponential(fInt exponent); /* Can be used to calculate e^exponent */
fInt fNaturalLog(fInt value); /* Can be used to calculate ln(value) */ static fInt fNaturalLog(fInt value); /* Can be used to calculate ln(value) */
/* Fuse decoding functions /* Fuse decoding functions
* ------------------------------------------------------------------------------------- * -------------------------------------------------------------------------------------
*/ */
fInt fDecodeLinearFuse(uint32_t fuse_value, fInt f_min, fInt f_range, uint32_t bitlength); static fInt fDecodeLinearFuse(uint32_t fuse_value, fInt f_min, fInt f_range, uint32_t bitlength);
fInt fDecodeLogisticFuse(uint32_t fuse_value, fInt f_average, fInt f_range, uint32_t bitlength); static fInt fDecodeLogisticFuse(uint32_t fuse_value, fInt f_average, fInt f_range, uint32_t bitlength);
fInt fDecodeLeakageID (uint32_t leakageID_fuse, fInt ln_max_div_min, fInt f_min, uint32_t bitlength); static fInt fDecodeLeakageID (uint32_t leakageID_fuse, fInt ln_max_div_min, fInt f_min, uint32_t bitlength);
/* Internal Support Functions - Use these ONLY for testing or adding to internal functions /* Internal Support Functions - Use these ONLY for testing or adding to internal functions
* ------------------------------------------------------------------------------------- * -------------------------------------------------------------------------------------
* Some of the following functions take two INTs as their input - This is unsafe for a variety of reasons. * Some of the following functions take two INTs as their input - This is unsafe for a variety of reasons.
*/ */
fInt Add (int, int); /* Add two INTs and return Sum as FINT */ static fInt Add (int, int); /* Add two INTs and return Sum as FINT */
fInt Multiply (int, int); /* Multiply two INTs and return Product as FINT */ static fInt Multiply (int, int); /* Multiply two INTs and return Product as FINT */
fInt Divide (int, int); /* You get the idea... */ static fInt Divide (int, int); /* You get the idea... */
fInt fNegate(fInt); static fInt fNegate(fInt);
int uGetScaledDecimal (fInt); /* Internal function */ static int uGetScaledDecimal (fInt); /* Internal function */
int GetReal (fInt A); /* Internal function */ static int GetReal (fInt A); /* Internal function */
/* Future Additions and Incomplete Functions /* Future Additions and Incomplete Functions
* ------------------------------------------------------------------------------------- * -------------------------------------------------------------------------------------
*/ */
int GetRoundedValue(fInt); /* Incomplete function - Useful only when Precision is lacking */ static int GetRoundedValue(fInt); /* Incomplete function - Useful only when Precision is lacking */
/* Let us say we have 2.126 but can only handle 2 decimal points. We could */ /* Let us say we have 2.126 but can only handle 2 decimal points. We could */
/* either chop of 6 and keep 2.12 or use this function to get 2.13, which is more accurate */ /* either chop of 6 and keep 2.12 or use this function to get 2.13, which is more accurate */
@ -115,7 +115,7 @@ int GetRoundedValue(fInt); /* Incomplete function - Usef
* START OF CODE * START OF CODE
* ------------------------------------------------------------------------------------- * -------------------------------------------------------------------------------------
*/ */
fInt fExponential(fInt exponent) /*Can be used to calculate e^exponent*/ static fInt fExponential(fInt exponent) /*Can be used to calculate e^exponent*/
{ {
uint32_t i; uint32_t i;
bool bNegated = false; bool bNegated = false;
@ -154,7 +154,7 @@ fInt fExponential(fInt exponent) /*Can be used to calculate e^exponent*/
return solution; return solution;
} }
fInt fNaturalLog(fInt value) static fInt fNaturalLog(fInt value)
{ {
uint32_t i; uint32_t i;
fInt upper_bound = Divide(8, 1000); fInt upper_bound = Divide(8, 1000);
@ -179,7 +179,7 @@ fInt fNaturalLog(fInt value)
return (fAdd(solution, error_term)); return (fAdd(solution, error_term));
} }
fInt fDecodeLinearFuse(uint32_t fuse_value, fInt f_min, fInt f_range, uint32_t bitlength) static fInt fDecodeLinearFuse(uint32_t fuse_value, fInt f_min, fInt f_range, uint32_t bitlength)
{ {
fInt f_fuse_value = Convert_ULONG_ToFraction(fuse_value); fInt f_fuse_value = Convert_ULONG_ToFraction(fuse_value);
fInt f_bit_max_value = Convert_ULONG_ToFraction((uPow(2, bitlength)) - 1); fInt f_bit_max_value = Convert_ULONG_ToFraction((uPow(2, bitlength)) - 1);
@ -194,7 +194,7 @@ fInt fDecodeLinearFuse(uint32_t fuse_value, fInt f_min, fInt f_range, uint32_t b
} }
fInt fDecodeLogisticFuse(uint32_t fuse_value, fInt f_average, fInt f_range, uint32_t bitlength) static fInt fDecodeLogisticFuse(uint32_t fuse_value, fInt f_average, fInt f_range, uint32_t bitlength)
{ {
fInt f_fuse_value = Convert_ULONG_ToFraction(fuse_value); fInt f_fuse_value = Convert_ULONG_ToFraction(fuse_value);
fInt f_bit_max_value = Convert_ULONG_ToFraction((uPow(2, bitlength)) - 1); fInt f_bit_max_value = Convert_ULONG_ToFraction((uPow(2, bitlength)) - 1);
@ -212,7 +212,7 @@ fInt fDecodeLogisticFuse(uint32_t fuse_value, fInt f_average, fInt f_range, uint
return f_decoded_value; return f_decoded_value;
} }
fInt fDecodeLeakageID (uint32_t leakageID_fuse, fInt ln_max_div_min, fInt f_min, uint32_t bitlength) static fInt fDecodeLeakageID (uint32_t leakageID_fuse, fInt ln_max_div_min, fInt f_min, uint32_t bitlength)
{ {
fInt fLeakage; fInt fLeakage;
fInt f_bit_max_value = Convert_ULONG_ToFraction((uPow(2, bitlength)) - 1); fInt f_bit_max_value = Convert_ULONG_ToFraction((uPow(2, bitlength)) - 1);
@ -225,7 +225,7 @@ fInt fDecodeLeakageID (uint32_t leakageID_fuse, fInt ln_max_div_min, fInt f_min,
return fLeakage; return fLeakage;
} }
fInt ConvertToFraction(int X) /*Add all range checking here. Is it possible to make fInt a private declaration? */ static fInt ConvertToFraction(int X) /*Add all range checking here. Is it possible to make fInt a private declaration? */
{ {
fInt temp; fInt temp;
@ -237,13 +237,13 @@ fInt ConvertToFraction(int X) /*Add all range checking here. Is it possible to m
return temp; return temp;
} }
fInt fNegate(fInt X) static fInt fNegate(fInt X)
{ {
fInt CONSTANT_NEGONE = ConvertToFraction(-1); fInt CONSTANT_NEGONE = ConvertToFraction(-1);
return (fMultiply(X, CONSTANT_NEGONE)); return (fMultiply(X, CONSTANT_NEGONE));
} }
fInt Convert_ULONG_ToFraction(uint32_t X) static fInt Convert_ULONG_ToFraction(uint32_t X)
{ {
fInt temp; fInt temp;
@ -255,7 +255,7 @@ fInt Convert_ULONG_ToFraction(uint32_t X)
return temp; return temp;
} }
fInt GetScaledFraction(int X, int factor) static fInt GetScaledFraction(int X, int factor)
{ {
int times_shifted, factor_shifted; int times_shifted, factor_shifted;
bool bNEGATED; bool bNEGATED;
@ -304,7 +304,7 @@ fInt GetScaledFraction(int X, int factor)
} }
/* Addition using two fInts */ /* Addition using two fInts */
fInt fAdd (fInt X, fInt Y) static fInt fAdd (fInt X, fInt Y)
{ {
fInt Sum; fInt Sum;
@ -314,7 +314,7 @@ fInt fAdd (fInt X, fInt Y)
} }
/* Addition using two fInts */ /* Addition using two fInts */
fInt fSubtract (fInt X, fInt Y) static fInt fSubtract (fInt X, fInt Y)
{ {
fInt Difference; fInt Difference;
@ -323,7 +323,7 @@ fInt fSubtract (fInt X, fInt Y)
return Difference; return Difference;
} }
bool Equal(fInt A, fInt B) static bool Equal(fInt A, fInt B)
{ {
if (A.full == B.full) if (A.full == B.full)
return true; return true;
@ -331,7 +331,7 @@ bool Equal(fInt A, fInt B)
return false; return false;
} }
bool GreaterThan(fInt A, fInt B) static bool GreaterThan(fInt A, fInt B)
{ {
if (A.full > B.full) if (A.full > B.full)
return true; return true;
@ -339,7 +339,7 @@ bool GreaterThan(fInt A, fInt B)
return false; return false;
} }
fInt fMultiply (fInt X, fInt Y) /* Uses 64-bit integers (int64_t) */ static fInt fMultiply (fInt X, fInt Y) /* Uses 64-bit integers (int64_t) */
{ {
fInt Product; fInt Product;
int64_t tempProduct; int64_t tempProduct;
@ -363,7 +363,7 @@ fInt fMultiply (fInt X, fInt Y) /* Uses 64-bit integers (int64_t) */
return Product; return Product;
} }
fInt fDivide (fInt X, fInt Y) static fInt fDivide (fInt X, fInt Y)
{ {
fInt fZERO, fQuotient; fInt fZERO, fQuotient;
int64_t longlongX, longlongY; int64_t longlongX, longlongY;
@ -384,7 +384,7 @@ fInt fDivide (fInt X, fInt Y)
return fQuotient; return fQuotient;
} }
int ConvertBackToInteger (fInt A) /*THIS is the function that will be used to check with the Golden settings table*/ static int ConvertBackToInteger (fInt A) /*THIS is the function that will be used to check with the Golden settings table*/
{ {
fInt fullNumber, scaledDecimal, scaledReal; fInt fullNumber, scaledDecimal, scaledReal;
@ -397,13 +397,13 @@ int ConvertBackToInteger (fInt A) /*THIS is the function that will be used to ch
return fullNumber.full; return fullNumber.full;
} }
fInt fGetSquare(fInt A) static fInt fGetSquare(fInt A)
{ {
return fMultiply(A,A); return fMultiply(A,A);
} }
/* x_new = x_old - (x_old^2 - C) / (2 * x_old) */ /* x_new = x_old - (x_old^2 - C) / (2 * x_old) */
fInt fSqrt(fInt num) static fInt fSqrt(fInt num)
{ {
fInt F_divide_Fprime, Fprime; fInt F_divide_Fprime, Fprime;
fInt test; fInt test;
@ -460,7 +460,7 @@ fInt fSqrt(fInt num)
return (x_new); return (x_new);
} }
void SolveQuadracticEqn(fInt A, fInt B, fInt C, fInt Roots[]) static 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;
@ -499,7 +499,7 @@ void SolveQuadracticEqn(fInt A, fInt B, fInt C, fInt Roots[])
*/ */
/* Addition using two normal ints - Temporary - Use only for testing purposes?. */ /* Addition using two normal ints - Temporary - Use only for testing purposes?. */
fInt Add (int X, int Y) static fInt Add (int X, int Y)
{ {
fInt A, B, Sum; fInt A, B, Sum;
@ -512,13 +512,13 @@ fInt Add (int X, int Y)
} }
/* Conversion Functions */ /* Conversion Functions */
int GetReal (fInt A) static int GetReal (fInt A)
{ {
return (A.full >> SHIFT_AMOUNT); return (A.full >> SHIFT_AMOUNT);
} }
/* Temporarily Disabled */ /* Temporarily Disabled */
int GetRoundedValue(fInt A) /*For now, round the 3rd decimal place */ static 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;
@ -531,7 +531,7 @@ int GetRoundedValue(fInt A) /*For now, round the 3rd decimal place */
return ConvertBackToInteger(A)/10000; /*Temporary - in case this was used somewhere else */ return ConvertBackToInteger(A)/10000; /*Temporary - in case this was used somewhere else */
} }
fInt Multiply (int X, int Y) static fInt Multiply (int X, int Y)
{ {
fInt A, B, Product; fInt A, B, Product;
@ -543,7 +543,7 @@ fInt Multiply (int X, int Y)
return Product; return Product;
} }
fInt Divide (int X, int Y) static fInt Divide (int X, int Y)
{ {
fInt A, B, Quotient; fInt A, B, Quotient;
@ -555,7 +555,7 @@ fInt Divide (int X, int Y)
return Quotient; return Quotient;
} }
int uGetScaledDecimal (fInt A) /*Converts the fractional portion to whole integers - Costly function */ static int uGetScaledDecimal (fInt A) /*Converts the fractional portion to whole integers - Costly function */
{ {
int dec[PRECISION]; int dec[PRECISION];
int i, scaledDecimal = 0, tmp = A.partial.decimal; int i, scaledDecimal = 0, tmp = A.partial.decimal;
@ -570,7 +570,7 @@ int uGetScaledDecimal (fInt A) /*Converts the fractional portion to whole intege
return scaledDecimal; return scaledDecimal;
} }
int uPow(int base, int power) static int uPow(int base, int power)
{ {
if (power == 0) if (power == 0)
return 1; return 1;
@ -578,7 +578,7 @@ int uPow(int base, int power)
return (base)*uPow(base, power - 1); return (base)*uPow(base, power - 1);
} }
fInt fAbs(fInt A) static fInt fAbs(fInt A)
{ {
if (A.partial.real < 0) if (A.partial.real < 0)
return (fMultiply(A, ConvertToFraction(-1))); return (fMultiply(A, ConvertToFraction(-1)));
@ -586,7 +586,7 @@ fInt fAbs(fInt A)
return A; return A;
} }
int uAbs(int X) static int uAbs(int X)
{ {
if (X < 0) if (X < 0)
return (X * -1); return (X * -1);
@ -594,7 +594,7 @@ int uAbs(int X)
return X; return X;
} }
fInt fRoundUpByStepSize(fInt A, fInt fStepSize, bool error_term) static fInt fRoundUpByStepSize(fInt A, fInt fStepSize, bool error_term)
{ {
fInt solution; fInt solution;