Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d338e1a authored by Al Viro's avatar Al Viro Committed by Linus Torvalds
Browse files

[PATCH] uml: sparse cleanups



misc sparse annotations

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 694a464e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ static int harddog_release(struct inode *inode, struct file *file)

extern int ping_watchdog(int fd);

static ssize_t harddog_write(struct file *file, const char *data, size_t len,
static ssize_t harddog_write(struct file *file, const char __user *data, size_t len,
			     loff_t *ppos)
{
	/*
@@ -118,6 +118,7 @@ static ssize_t harddog_write(struct file *file, const char *data, size_t len,
static int harddog_ioctl(struct inode *inode, struct file *file,
			 unsigned int cmd, unsigned long arg)
{
	void __user *argp= (void __user *)arg;
	static struct watchdog_info ident = {
		WDIOC_SETTIMEOUT,
		0,
@@ -127,13 +128,12 @@ static int harddog_ioctl(struct inode *inode, struct file *file,
		default:
			return -ENOTTY;
		case WDIOC_GETSUPPORT:
			if(copy_to_user((struct harddog_info *)arg, &ident,
					sizeof(ident)))
			if(copy_to_user(argp, &ident, sizeof(ident)))
				return -EFAULT;
			return 0;
		case WDIOC_GETSTATUS:
		case WDIOC_GETBOOTSTATUS:
			return put_user(0,(int *)arg);
			return put_user(0,(int __user *)argp);
		case WDIOC_KEEPALIVE:
			return(ping_watchdog(harddog_out_fd));
	}
+5 −5
Original line number Diff line number Diff line
@@ -67,8 +67,8 @@ MODULE_PARM_DESC(mixer, MIXER_HELP);

/* /dev/dsp file operations */

static ssize_t hostaudio_read(struct file *file, char *buffer, size_t count, 
			      loff_t *ppos)
static ssize_t hostaudio_read(struct file *file, char __user *buffer,
			      size_t count, loff_t *ppos)
{
        struct hostaudio_state *state = file->private_data;
	void *kbuf;
@@ -94,7 +94,7 @@ static ssize_t hostaudio_read(struct file *file, char *buffer, size_t count,
	return(err);
}

static ssize_t hostaudio_write(struct file *file, const char *buffer, 
static ssize_t hostaudio_write(struct file *file, const char __user *buffer,
			       size_t count, loff_t *ppos)
{
        struct hostaudio_state *state = file->private_data;
@@ -152,7 +152,7 @@ static int hostaudio_ioctl(struct inode *inode, struct file *file,
	case SNDCTL_DSP_CHANNELS:
	case SNDCTL_DSP_SUBDIVIDE:
	case SNDCTL_DSP_SETFRAGMENT:
		if(get_user(data, (int *) arg))
		if(get_user(data, (int __user *) arg))
			return(-EFAULT);
		break;
	default:
@@ -168,7 +168,7 @@ static int hostaudio_ioctl(struct inode *inode, struct file *file,
	case SNDCTL_DSP_CHANNELS:
	case SNDCTL_DSP_SUBDIVIDE:
	case SNDCTL_DSP_SETFRAGMENT:
		if(put_user(data, (int *) arg))
		if(put_user(data, (int __user *) arg))
			return(-EFAULT);
		break;
	default:
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ static int slirp_setup(char *str, char **mac_out, void *data)
	int i=0;

	*init = ((struct slirp_init)
		{ argw :		{ { "slirp", NULL  } } });
		{ .argw = { { "slirp", NULL  } } });

	str = split_if_spec(str, mac_out, NULL);

+6 −12
Original line number Diff line number Diff line
@@ -58,23 +58,17 @@ struct line {
};

#define LINE_INIT(str, d) \
	{ init_str :	str, \
	  init_pri :	INIT_STATIC, \
	  valid :	1, \
	  throttled :	0, \
	  lock :	SPIN_LOCK_UNLOCKED, \
	  buffer :	NULL, \
	  head :	NULL, \
	  tail :	NULL, \
	  sigio :	0, \
	  driver :	d, \
	  have_irq :	0 }
	{ .init_str =	str, \
	  .init_pri =	INIT_STATIC, \
	  .valid =	1, \
	  .lock =	SPIN_LOCK_UNLOCKED, \
	  .driver =	d }

struct lines {
	int num;
};

#define LINES_INIT(n) {  num :		n }
#define LINES_INIT(n) {  .num =	n }

extern void line_close(struct tty_struct *tty, struct file * filp);
extern int line_open(struct line *lines, struct tty_struct *tty);
+3 −2
Original line number Diff line number Diff line
@@ -48,7 +48,8 @@ unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *
 */

static __inline__
unsigned int csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst,
unsigned int csum_partial_copy_from_user(const unsigned char __user *src,
					 unsigned char *dst,
					 int len, int sum, int *err_ptr)
{
	if(copy_from_user(dst, src, len)){
@@ -192,7 +193,7 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
 */
#define HAVE_CSUM_COPY_USER
static __inline__ unsigned int csum_and_copy_to_user(const unsigned char *src,
						     unsigned char *dst,
						     unsigned char __user *dst,
						     int len, int sum, int *err_ptr)
{
	if (access_ok(VERIFY_WRITE, dst, len)){
Loading