summaryrefslogtreecommitdiff
path: root/include/linux/random.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-03-23 10:15:18 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-03-23 10:15:18 +0300
commitaa18bc8ddcb3ffe3fdb87a59b81371fb8bceea38 (patch)
tree0547955f584ec0865ddaf0762053f69279a014e7 /include/linux/random.h
parent93aa2a1c25e562cc0ca69c3175333fe33fdf055b (diff)
parent65d1086c44791112188f6aebbdc3a27cab3736d3 (diff)
downloadlinux-aa18bc8ddcb3ffe3fdb87a59b81371fb8bceea38.tar.xz
Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next-queued
Backmerge drm-next to get at the hdmi2.0 helper functions. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'include/linux/random.h')
-rw-r--r--include/linux/random.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/linux/random.h b/include/linux/random.h
index 7bd2403e4fef..ed5c3838780d 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -37,14 +37,26 @@ extern void get_random_bytes(void *buf, int nbytes);
extern int add_random_ready_callback(struct random_ready_callback *rdy);
extern void del_random_ready_callback(struct random_ready_callback *rdy);
extern void get_random_bytes_arch(void *buf, int nbytes);
-extern int random_int_secret_init(void);
#ifndef MODULE
extern const struct file_operations random_fops, urandom_fops;
#endif
-unsigned int get_random_int(void);
-unsigned long get_random_long(void);
+u32 get_random_u32(void);
+u64 get_random_u64(void);
+static inline unsigned int get_random_int(void)
+{
+ return get_random_u32();
+}
+static inline unsigned long get_random_long(void)
+{
+#if BITS_PER_LONG == 64
+ return get_random_u64();
+#else
+ return get_random_u32();
+#endif
+}
+
unsigned long randomize_page(unsigned long start, unsigned long range);
u32 prandom_u32(void);