uml: style fixes in the random driver

Give random.c a style workover while I'm changing it.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Jeff Dike 2008-05-12 14:01:59 -07:00 committed by Linus Torvalds
parent 5d33e4d7fd
commit 3d88958e01

View file

@ -1,4 +1,5 @@
/* Copyright (C) 2005 Jeff Dike <jdike@addtoit.com> */ /* Copyright (C) 2005 - 2008 Jeff Dike <jdike@{linux.intel,addtoit}.com> */
/* Much of this ripped from drivers/char/hw_random.c, see there for other /* Much of this ripped from drivers/char/hw_random.c, see there for other
* copyright. * copyright.
* *
@ -35,7 +36,7 @@ static int rng_dev_open (struct inode *inode, struct file *filp)
/* enforce read-only access to this chrdev */ /* enforce read-only access to this chrdev */
if ((filp->f_mode & FMODE_READ) == 0) if ((filp->f_mode & FMODE_READ) == 0)
return -EINVAL; return -EINVAL;
if (filp->f_mode & FMODE_WRITE) if ((filp->f_mode & FMODE_WRITE) != 0)
return -EINVAL; return -EINVAL;
return 0; return 0;
@ -86,7 +87,9 @@ static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size,
deactivate_fd(random_fd, RANDOM_IRQ); deactivate_fd(random_fd, RANDOM_IRQ);
} }
} }
else return n; else
return n;
if (signal_pending (current)) if (signal_pending (current))
return ret ? : -ERESTARTSYS; return ret ? : -ERESTARTSYS;
} }
@ -136,10 +139,10 @@ static int __init rng_init (void)
err = misc_register (&rng_miscdev); err = misc_register (&rng_miscdev);
if (err) { if (err) {
printk (KERN_ERR RNG_MODULE_NAME ": misc device register failed\n"); printk (KERN_ERR RNG_MODULE_NAME ": misc device register "
"failed\n");
goto err_out_cleanup_hw; goto err_out_cleanup_hw;
} }
out: out:
return err; return err;