random: clean up checkpatch complaints
Signed-off-by: Matt Mackall <mpm@selenic.com> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
0302190411
commit
90b75ee546
@@ -272,7 +272,7 @@ static int random_write_wakeup_thresh = 128;
|
|||||||
|
|
||||||
static int trickle_thresh __read_mostly = INPUT_POOL_WORDS * 28;
|
static int trickle_thresh __read_mostly = INPUT_POOL_WORDS * 28;
|
||||||
|
|
||||||
static DEFINE_PER_CPU(int, trickle_count) = 0;
|
static DEFINE_PER_CPU(int, trickle_count);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A pool of size .poolwords is stirred with a primitive polynomial
|
* A pool of size .poolwords is stirred with a primitive polynomial
|
||||||
@@ -372,9 +372,10 @@ static DECLARE_WAIT_QUEUE_HEAD(random_read_wait);
|
|||||||
static DECLARE_WAIT_QUEUE_HEAD(random_write_wait);
|
static DECLARE_WAIT_QUEUE_HEAD(random_write_wait);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static int debug = 0;
|
static int debug;
|
||||||
module_param(debug, bool, 0644);
|
module_param(debug, bool, 0644);
|
||||||
#define DEBUG_ENT(fmt, arg...) do { if (debug) \
|
#define DEBUG_ENT(fmt, arg...) do { \
|
||||||
|
if (debug) \
|
||||||
printk(KERN_DEBUG "random %04d %04d %04d: " \
|
printk(KERN_DEBUG "random %04d %04d %04d: " \
|
||||||
fmt,\
|
fmt,\
|
||||||
input_pool.entropy_count,\
|
input_pool.entropy_count,\
|
||||||
@@ -872,7 +873,6 @@ void get_random_bytes(void *buf, int nbytes)
|
|||||||
{
|
{
|
||||||
extract_entropy(&nonblocking_pool, buf, nbytes, 0, 0);
|
extract_entropy(&nonblocking_pool, buf, nbytes, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(get_random_bytes);
|
EXPORT_SYMBOL(get_random_bytes);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1002,8 +1002,7 @@ random_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
urandom_read(struct file * file, char __user * buf,
|
urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
|
||||||
size_t nbytes, loff_t *ppos)
|
|
||||||
{
|
{
|
||||||
return extract_entropy_user(&nonblocking_pool, buf, nbytes);
|
return extract_entropy_user(&nonblocking_pool, buf, nbytes);
|
||||||
}
|
}
|
||||||
@@ -1045,8 +1044,7 @@ write_pool(struct entropy_store *r, const char __user *buffer, size_t count)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t random_write(struct file *file, const char __user *buffer,
|
||||||
random_write(struct file * file, const char __user * buffer,
|
|
||||||
size_t count, loff_t *ppos)
|
size_t count, loff_t *ppos)
|
||||||
{
|
{
|
||||||
size_t ret;
|
size_t ret;
|
||||||
@@ -1064,8 +1062,7 @@ random_write(struct file * file, const char __user * buffer,
|
|||||||
return (ssize_t)count;
|
return (ssize_t)count;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int random_ioctl(struct inode *inode, struct file *file,
|
||||||
random_ioctl(struct inode * inode, struct file * file,
|
|
||||||
unsigned int cmd, unsigned long arg)
|
unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
int size, ent_count;
|
int size, ent_count;
|
||||||
@@ -1157,7 +1154,6 @@ void generate_random_uuid(unsigned char uuid_out[16])
|
|||||||
/* Set the UUID variant to DCE */
|
/* Set the UUID variant to DCE */
|
||||||
uuid_out[8] = (uuid_out[8] & 0x3F) | 0x80;
|
uuid_out[8] = (uuid_out[8] & 0x3F) | 0x80;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(generate_random_uuid);
|
EXPORT_SYMBOL(generate_random_uuid);
|
||||||
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
@@ -1556,10 +1552,7 @@ __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
|
|||||||
* Choosing a clock of 64 ns period is OK. (period of 274 s)
|
* Choosing a clock of 64 ns period is OK. (period of 274 s)
|
||||||
*/
|
*/
|
||||||
seq += ktime_to_ns(ktime_get_real()) >> 6;
|
seq += ktime_to_ns(ktime_get_real()) >> 6;
|
||||||
#if 0
|
|
||||||
printk("init_seq(%lx, %lx, %d, %d) = %d\n",
|
|
||||||
saddr, daddr, sport, dport, seq);
|
|
||||||
#endif
|
|
||||||
return seq;
|
return seq;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1582,7 +1575,8 @@ u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
|
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
|
||||||
u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, __be16 dport)
|
u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
|
||||||
|
__be16 dport)
|
||||||
{
|
{
|
||||||
struct keydata *keyptr = get_keyptr();
|
struct keydata *keyptr = get_keyptr();
|
||||||
u32 hash[12];
|
u32 hash[12];
|
||||||
@@ -1617,13 +1611,9 @@ u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
|
|||||||
|
|
||||||
seq += ktime_to_ns(ktime_get_real());
|
seq += ktime_to_ns(ktime_get_real());
|
||||||
seq &= (1ull << 48) - 1;
|
seq &= (1ull << 48) - 1;
|
||||||
#if 0
|
|
||||||
printk("dccp init_seq(%lx, %lx, %d, %d) = %d\n",
|
|
||||||
saddr, daddr, sport, dport, seq);
|
|
||||||
#endif
|
|
||||||
return seq;
|
return seq;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(secure_dccp_sequence_number);
|
EXPORT_SYMBOL(secure_dccp_sequence_number);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user