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:
17
lib/random.c
17
lib/random.c
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user