Commit 31ff9ba8 authored by Nishanth Menon's avatar Nishanth Menon

[COMMON][LIB] Fix up inlines

Dont keep inlines in public functions, just make them static inlines

Confuses the heck out of gcc 5.1

Fixes:
common/mem.h:59:14: warning: inline function 'mem_phys2virt' declared but never defined
 inline void *mem_phys2virt(void *addr);
              ^
In file included from omapconf.c:49:0:
common/lib.h:237:12: warning: inline function 'mhz2khz' declared but never defined
 inline int mhz2khz(double mhz);
            ^
common/lib.h:236:15: warning: inline function 'khz2mhz' declared but never defined
 inline double khz2mhz(int khz);
               ^
common/lib.h:234:12: warning: inline function 'v2uv' declared but never defined
 inline int v2uv(double v);
            ^
common/lib.h:233:15: warning: inline function 'uv2v' declared but never defined
 inline double uv2v(int uv);
Reported-by: default avatarRobert C Nelson <robertcnelson@gmail.com>
Signed-off-by: default avatarNishanth Menon <nm@ti.com>
parent e821a16e
......@@ -1540,63 +1540,6 @@ int celcius2fahrenheit(int d)
return ((d * 9) / 5) + 32;
}
/* ------------------------------------------------------------------------*//**
* @FUNCTION uv2v
* @BRIEF convert micro-volt (integer) to volt (floating point).
* @RETURNS voltage in volt (V)
* @param[in] uv: voltage in micro-volt (uV)
* @DESCRIPTION convert micro-volt (integer) to volt (floating point).
*//*------------------------------------------------------------------------ */
inline double uv2v(int uv)
{
double v;
v = ((double) uv) / 1000000.0;
dprintf("%s(): uv=%d, v=%lf\n", __func__, uv, v);
return v;
}
/* ------------------------------------------------------------------------*//**
* @FUNCTION v2uv
* @BRIEF convert volt (floating point) to micro-volt (integer).
* @RETURNS voltage in micro-volt (uV)
* @param[in] v: voltage in volt (V)
* @DESCRIPTION convert volt (floating point) to micro-volt (integer).
*//*------------------------------------------------------------------------ */
inline int v2uv(double v)
{
return (int) (v * 1000000.0);
}
/* ------------------------------------------------------------------------*//**
* @FUNCTION khz2mhz
* @BRIEF convert KHz (integer) to MHz (floating point).
* @RETURNS frequency in MHz
* @param[in] khz: frequency in KHz
* @DESCRIPTION convert KHz (integer) to MHz (floating point).
*//*------------------------------------------------------------------------ */
inline double khz2mhz(int khz)
{
return ((double) khz) / 1000.0;
}
/* ------------------------------------------------------------------------*//**
* @FUNCTION mhz2khz
* @BRIEF convert MHz (floating point) to KHz (integer).
* @RETURNS frequency in KHz
* @param[in] mhz: frequency in MHz
* @DESCRIPTION convert MHz (floating point) to KHz (integer).
*//*------------------------------------------------------------------------ */
inline int mhz2khz(double mhz)
{
return (int) (mhz * 1000.0);
}
/* ------------------------------------------------------------------------*//**
* @FUNCTION omapconf_getdefaults
* @BRIEF Gets defaults from a file and returns ints or strings in
......
......@@ -230,11 +230,57 @@ double avg_recalc(double prev_avg, double new_val, unsigned int n);
int celcius2fahrenheit(int d);
inline double uv2v(int uv);
inline int v2uv(double v);
/* ------------------------------------------------------------------------*//**
* @FUNCTION uv2v
* @BRIEF convert micro-volt (integer) to volt (floating point).
* @RETURNS voltage in volt (V)
* @param[in] uv: voltage in micro-volt (uV)
* @DESCRIPTION convert micro-volt (integer) to volt (floating point).
*//*------------------------------------------------------------------------ */
static inline double uv2v(int uv)
{
double v;
v = ((double) uv) / 1000000.0;
return v;
}
/* ------------------------------------------------------------------------*//**
* @FUNCTION v2uv
* @BRIEF convert volt (floating point) to micro-volt (integer).
* @RETURNS voltage in micro-volt (uV)
* @param[in] v: voltage in volt (V)
* @DESCRIPTION convert volt (floating point) to micro-volt (integer).
*//*------------------------------------------------------------------------ */
static inline int v2uv(double v)
{
return (int) (v * 1000000.0);
}
/* ------------------------------------------------------------------------*//**
* @FUNCTION khz2mhz
* @BRIEF convert KHz (integer) to MHz (floating point).
* @RETURNS frequency in MHz
* @param[in] khz: frequency in KHz
* @DESCRIPTION convert KHz (integer) to MHz (floating point).
*//*------------------------------------------------------------------------ */
static inline double khz2mhz(int khz)
{
return ((double) khz) / 1000.0;
}
/* ------------------------------------------------------------------------*//**
* @FUNCTION mhz2khz
* @BRIEF convert MHz (floating point) to KHz (integer).
* @RETURNS frequency in KHz
* @param[in] mhz: frequency in MHz
* @DESCRIPTION convert MHz (floating point) to KHz (integer).
*//*------------------------------------------------------------------------ */
static inline int mhz2khz(double mhz)
{
return (int) (mhz * 1000.0);
}
inline double khz2mhz(int khz);
inline int mhz2khz(double mhz);
int omapconf_getdefaults(
char *defaults_file, char *prefix, name_desc_val_table tablep[]);
......
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