random: remove extern from functions in header
commit 7782cfeca7d420e8bb707613d4cfb0f7ff29bb3a upstream. Accoriding to the kernel style guide, having `extern` on functions in headers is old school and deprecated, and doesn't add anything. So remove them from random.h, and tidy up the file a little bit too. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
811afd06e0
commit
1fdd7eef21
@@ -12,13 +12,12 @@
|
|||||||
|
|
||||||
struct notifier_block;
|
struct notifier_block;
|
||||||
|
|
||||||
extern void add_device_randomness(const void *, size_t);
|
void add_device_randomness(const void *, size_t);
|
||||||
extern void add_bootloader_randomness(const void *, size_t);
|
void add_bootloader_randomness(const void *, size_t);
|
||||||
extern void add_input_randomness(unsigned int type, unsigned int code,
|
void add_input_randomness(unsigned int type, unsigned int code,
|
||||||
unsigned int value) __latent_entropy;
|
unsigned int value) __latent_entropy;
|
||||||
extern void add_interrupt_randomness(int irq) __latent_entropy;
|
void add_interrupt_randomness(int irq) __latent_entropy;
|
||||||
extern void add_hwgenerator_randomness(const void *buffer, size_t count,
|
void add_hwgenerator_randomness(const void *buffer, size_t count, size_t entropy);
|
||||||
size_t entropy);
|
|
||||||
|
|
||||||
#if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__)
|
#if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__)
|
||||||
static inline void add_latent_entropy(void)
|
static inline void add_latent_entropy(void)
|
||||||
@@ -29,18 +28,8 @@ static inline void add_latent_entropy(void)
|
|||||||
static inline void add_latent_entropy(void) { }
|
static inline void add_latent_entropy(void) { }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void get_random_bytes(void *buf, size_t nbytes);
|
void get_random_bytes(void *buf, size_t nbytes);
|
||||||
extern int wait_for_random_bytes(void);
|
size_t __must_check get_random_bytes_arch(void *buf, size_t nbytes);
|
||||||
extern int __init random_init(const char *command_line);
|
|
||||||
extern bool rng_is_initialized(void);
|
|
||||||
extern int register_random_ready_notifier(struct notifier_block *nb);
|
|
||||||
extern int unregister_random_ready_notifier(struct notifier_block *nb);
|
|
||||||
extern size_t __must_check get_random_bytes_arch(void *buf, size_t nbytes);
|
|
||||||
|
|
||||||
#ifndef MODULE
|
|
||||||
extern const struct file_operations random_fops, urandom_fops;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
u32 get_random_u32(void);
|
u32 get_random_u32(void);
|
||||||
u64 get_random_u64(void);
|
u64 get_random_u64(void);
|
||||||
static inline unsigned int get_random_int(void)
|
static inline unsigned int get_random_int(void)
|
||||||
@@ -72,11 +61,17 @@ static inline unsigned long get_random_long(void)
|
|||||||
|
|
||||||
static inline unsigned long get_random_canary(void)
|
static inline unsigned long get_random_canary(void)
|
||||||
{
|
{
|
||||||
unsigned long val = get_random_long();
|
return get_random_long() & CANARY_MASK;
|
||||||
|
|
||||||
return val & CANARY_MASK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned long randomize_page(unsigned long start, unsigned long range);
|
||||||
|
|
||||||
|
int __init random_init(const char *command_line);
|
||||||
|
bool rng_is_initialized(void);
|
||||||
|
int wait_for_random_bytes(void);
|
||||||
|
int register_random_ready_notifier(struct notifier_block *nb);
|
||||||
|
int unregister_random_ready_notifier(struct notifier_block *nb);
|
||||||
|
|
||||||
/* Calls wait_for_random_bytes() and then calls get_random_bytes(buf, nbytes).
|
/* Calls wait_for_random_bytes() and then calls get_random_bytes(buf, nbytes).
|
||||||
* Returns the result of the call to wait_for_random_bytes. */
|
* Returns the result of the call to wait_for_random_bytes. */
|
||||||
static inline int get_random_bytes_wait(void *buf, size_t nbytes)
|
static inline int get_random_bytes_wait(void *buf, size_t nbytes)
|
||||||
@@ -100,8 +95,6 @@ declare_get_random_var_wait(int)
|
|||||||
declare_get_random_var_wait(long)
|
declare_get_random_var_wait(long)
|
||||||
#undef declare_get_random_var
|
#undef declare_get_random_var
|
||||||
|
|
||||||
unsigned long randomize_page(unsigned long start, unsigned long range);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is designed to be standalone for just prandom
|
* This is designed to be standalone for just prandom
|
||||||
* users, but for now we include it from <linux/random.h>
|
* users, but for now we include it from <linux/random.h>
|
||||||
@@ -112,22 +105,10 @@ unsigned long randomize_page(unsigned long start, unsigned long range);
|
|||||||
#ifdef CONFIG_ARCH_RANDOM
|
#ifdef CONFIG_ARCH_RANDOM
|
||||||
# include <asm/archrandom.h>
|
# include <asm/archrandom.h>
|
||||||
#else
|
#else
|
||||||
static inline bool __must_check arch_get_random_long(unsigned long *v)
|
static inline bool __must_check arch_get_random_long(unsigned long *v) { return false; }
|
||||||
{
|
static inline bool __must_check arch_get_random_int(unsigned int *v) { return false; }
|
||||||
return false;
|
static inline bool __must_check arch_get_random_seed_long(unsigned long *v) { return false; }
|
||||||
}
|
static inline bool __must_check arch_get_random_seed_int(unsigned int *v) { return false; }
|
||||||
static inline bool __must_check arch_get_random_int(unsigned int *v)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
static inline bool __must_check arch_get_random_seed_long(unsigned long *v)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
static inline bool __must_check arch_get_random_seed_int(unsigned int *v)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -151,8 +132,12 @@ static inline bool __init arch_get_random_long_early(unsigned long *v)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
extern int random_prepare_cpu(unsigned int cpu);
|
int random_prepare_cpu(unsigned int cpu);
|
||||||
extern int random_online_cpu(unsigned int cpu);
|
int random_online_cpu(unsigned int cpu);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef MODULE
|
||||||
|
extern const struct file_operations random_fops, urandom_fops;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _LINUX_RANDOM_H */
|
#endif /* _LINUX_RANDOM_H */
|
||||||
|
Reference in New Issue
Block a user