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

Commit 67608e0c authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds
Browse files

[PATCH] uml: port driver formatting



Whitespace and style fixes.

Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d832fc60
Loading
Loading
Loading
Loading
+23 −23
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ static irqreturn_t pipe_interrupt(int irq, void *data)
	fd = os_rcv_fd(conn->socket[0], &conn->helper_pid);
	if(fd < 0){
		if(fd == -EAGAIN)
			return(IRQ_NONE);
			return IRQ_NONE;

		printk(KERN_ERR "pipe_interrupt : os_rcv_fd returned %d\n",
		       -fd);
@@ -68,7 +68,7 @@ static irqreturn_t pipe_interrupt(int irq, void *data)
	list_add(&conn->list, &conn->port->connections);

	complete(&conn->port->done);
	return(IRQ_HANDLED);
	return IRQ_HANDLED;
}

#define NO_WAITER_MSG \
@@ -117,7 +117,7 @@ static int port_accept(struct port_list *port)
		printk("No one waiting for port\n");
	}
	list_add(&conn->list, &port->pending);
	return(1);
	return 1;

 out_free:
	kfree(conn);
@@ -126,7 +126,7 @@ static int port_accept(struct port_list *port)
	if(pid != -1)
		os_kill_process(pid, 1);
 out:
	return(ret);
	return ret;
}

static DECLARE_MUTEX(ports_sem);
@@ -158,7 +158,7 @@ static irqreturn_t port_interrupt(int irq, void *data)

	port->has_connection = 1;
	schedule_work(&port_work);
	return(IRQ_HANDLED);
	return IRQ_HANDLED;
}

void *port_data(int port_num)
@@ -186,8 +186,8 @@ void *port_data(int port_num)
		goto out_free;
	}
	if(um_request_irq(ACCEPT_IRQ, fd, IRQ_READ, port_interrupt,
			  IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM, "port",
			  port)){
			  IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM,
			  "port", port)){
		printk(KERN_ERR "Failed to get IRQ for port %d\n", port_num);
		goto out_close;
	}
@@ -222,7 +222,7 @@ void *port_data(int port_num)
	os_close_file(fd);
 out:
	up(&ports_sem);
	return(dev);
	return dev;
}

int port_wait(void *data)
+20 −31
Original line number Diff line number Diff line
@@ -38,18 +38,18 @@ static void *port_init(char *str, int device, const struct chan_opts *opts)
	if(*str != ':'){
		printk("port_init : channel type 'port' must specify a "
		       "port number\n");
		return(NULL);
		return NULL;
	}
	str++;
	port = strtoul(str, &end, 0);
	if((*end != '\0') || (end == str)){
		printk("port_init : couldn't parse port '%s'\n", str);
		return(NULL);
		return NULL;
	}

	kern_data = port_data(port);
	if(kern_data == NULL)
		return(NULL);
		return NULL;

	data = um_kmalloc(sizeof(*data));
	if(data == NULL)
@@ -59,10 +59,10 @@ static void *port_init(char *str, int device, const struct chan_opts *opts)
				      .kernel_data 	= kern_data });
	sprintf(data->dev, "%d", port);

	return(data);
	return data;
 err:
	port_kern_free(kern_data);
	return(NULL);
	return NULL;
}

static void port_free(void *d)
@@ -83,14 +83,14 @@ static int port_open(int input, int output, int primary, void *d,
	if((fd >= 0) && data->raw){
		CATCH_EINTR(err = tcgetattr(fd, &data->tt));
		if(err)
			return(err);
			return err;

		err = raw(fd);
		if(err)
			return(err);
			return err;
	}
	*dev_out = data->dev;
	return(fd);
	return fd;
}

static void port_close(int fd, void *d)
@@ -121,7 +121,7 @@ int port_listen_fd(int port)

	fd = socket(PF_INET, SOCK_STREAM, 0);
	if(fd == -1)
		return(-errno);
		return -errno;

	arg = 1;
	if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &arg, sizeof(arg)) < 0){
@@ -146,10 +146,10 @@ int port_listen_fd(int port)
	if(err < 0)
		goto out;

	return(fd);
	return fd;
 out:
	os_close_file(fd);
	return(err);
	return err;
}

struct port_pre_exec_data {
@@ -179,7 +179,7 @@ int port_connection(int fd, int *socket, int *pid_out)

	new = os_accept_connection(fd);
	if(new < 0)
		return(new);
		return new;

	err = os_pipe(socket, 0, 0);
	if(err < 0)
@@ -194,7 +194,7 @@ int port_connection(int fd, int *socket, int *pid_out)
		goto out_shutdown;

	*pid_out = err;
	return(new);
	return new;

 out_shutdown:
	os_shutdown_socket(socket[0], 1, 1);
@@ -203,16 +203,5 @@ int port_connection(int fd, int *socket, int *pid_out)
	os_close_file(socket[1]);
 out_close:
	os_close_file(new);
	return(err);
	return err;
}

/*
 * Overrides for Emacs so that we follow Linus's tabbing style.
 * Emacs will notice this stuff at the end of the file and automatically
 * adjust the settings for this buffer only.  This must remain at the end
 * of the file.
 * ---------------------------------------------------------------------------
 * Local variables:
 * c-file-style: "linux"
 * End:
 */