/* Note, that this routine does not check for buffer overflow, it's the caller who must assure enough space. */
static void memsize_format(char *buf, u64 size)
/* Note, that this routine does not check for buffer overflow, it's the caller who must assure enough space. */
static void memsize_format(char *buf, u64 size)
{
#define SIZE_GB ((u32)1024*1024*1024)
#define SIZE_MB ((u32)1024*1024)
#define SIZE_KB ((u32)1024)
	if ((size % SIZE_GB) == 0)
		sprintf(buf, "%llug", size/SIZE_GB);
	else if ((size % SIZE_MB) == 0)
		sprintf(buf, "%llum", size/SIZE_MB);
	else if (size % SIZE_KB == 0)
		sprintf(buf, "%lluk", size/SIZE_KB);
	else
		sprintf(buf, "%llu", size);
}