Consolidate strmhz() implementation
ARM, i386, m68k and ppc all have identical implementations of strmhz(). Other architectures don't provide this function at all. This patch moves strmhz() into lib_generic, reducing code duplication and providing a more unified API across architectures. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
This commit is contained in:
committed by
Wolfgang Denk
parent
a928d0df21
commit
0768b7a872
@@ -115,19 +115,6 @@ void *sbrk (ptrdiff_t increment)
|
||||
return ((void *) old);
|
||||
}
|
||||
|
||||
char *strmhz(char *buf, long hz)
|
||||
{
|
||||
long l, n;
|
||||
long m;
|
||||
|
||||
n = hz / 1000000L;
|
||||
l = sprintf (buf, "%ld", n);
|
||||
m = (hz % 1000000L) / 1000L;
|
||||
if (m != 0)
|
||||
sprintf (buf + l, ".%03ld", m);
|
||||
return (buf);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* Coloured LED functionality
|
||||
|
||||
Reference in New Issue
Block a user