2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-19 14:37:21 +00:00

lib/random: Make some functions in random.c inline

random_range, random_uint8 and random_uint16 are basically just wrappers
around random_uint32. Hence, don't export these functions so the compiler
can be smarter when it comes to optimizations.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Helmut Schaa
2013-12-13 14:17:14 +01:00
committed by Ben Pfaff
parent e082203124
commit 2737b46d87
2 changed files with 18 additions and 20 deletions

View File

@@ -86,17 +86,6 @@ random_bytes(void *p_, size_t n)
}
}
uint8_t
random_uint8(void)
{
return random_uint32();
}
uint16_t
random_uint16(void)
{
return random_uint32();
}
uint32_t
random_uint32(void)
@@ -117,12 +106,6 @@ random_uint64(void)
return x;
}
int
random_range(int max)
{
return random_uint32() % max;
}
static uint32_t
random_next(void)
{