aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/random.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2016-06-08 15:38:38 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2016-06-08 15:41:20 -0400
commit117780eef7740729e803bdcc0d5f2f48137ea8e3 (patch)
tree63bd519e1d8b115d332fcb6e63ee4f94ee235161 /include/linux/random.h
parent2823d4da5d8a0c222747b24eceb65f5b30717d02 (diff)
x86, asm: use bool for bitops and other assembly outputs
The gcc people have confirmed that using "bool" when combined with inline assembly always is treated as a byte-sized operand that can be assumed to be 0 or 1, which is exactly what the SET instruction emits. Change the output types and intermediate variables of as many operations as practical to "bool". Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1465414726-197858-3-git-send-email-hpa@linux.intel.com Reviewed-by: Andy Lutomirski <luto@kernel.org> Reviewed-by: Borislav Petkov <bp@suse.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Diffstat (limited to 'include/linux/random.h')
-rw-r--r--include/linux/random.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/random.h b/include/linux/random.h
index e47e533742b5..3d6e9815cd85 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -95,27 +95,27 @@ static inline void prandom_seed_state(struct rnd_state *state, u64 seed)
95#ifdef CONFIG_ARCH_RANDOM 95#ifdef CONFIG_ARCH_RANDOM
96# include <asm/archrandom.h> 96# include <asm/archrandom.h>
97#else 97#else
98static inline int arch_get_random_long(unsigned long *v) 98static inline bool arch_get_random_long(unsigned long *v)
99{ 99{
100 return 0; 100 return 0;
101} 101}
102static inline int arch_get_random_int(unsigned int *v) 102static inline bool arch_get_random_int(unsigned int *v)
103{ 103{
104 return 0; 104 return 0;
105} 105}
106static inline int arch_has_random(void) 106static inline bool arch_has_random(void)
107{ 107{
108 return 0; 108 return 0;
109} 109}
110static inline int arch_get_random_seed_long(unsigned long *v) 110static inline bool arch_get_random_seed_long(unsigned long *v)
111{ 111{
112 return 0; 112 return 0;
113} 113}
114static inline int arch_get_random_seed_int(unsigned int *v) 114static inline bool arch_get_random_seed_int(unsigned int *v)
115{ 115{
116 return 0; 116 return 0;
117} 117}
118static inline int arch_has_random_seed(void) 118static inline bool arch_has_random_seed(void)
119{ 119{
120 return 0; 120 return 0;
121} 121}