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

[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
...@@ -55,7 +55,7 @@ static irqreturn_t pipe_interrupt(int irq, void *data) ...@@ -55,7 +55,7 @@ static irqreturn_t pipe_interrupt(int irq, void *data)
fd = os_rcv_fd(conn->socket[0], &conn->helper_pid); fd = os_rcv_fd(conn->socket[0], &conn->helper_pid);
if(fd < 0){ if(fd < 0){
if(fd == -EAGAIN) if(fd == -EAGAIN)
return(IRQ_NONE); return IRQ_NONE;
printk(KERN_ERR "pipe_interrupt : os_rcv_fd returned %d\n", printk(KERN_ERR "pipe_interrupt : os_rcv_fd returned %d\n",
-fd); -fd);
...@@ -68,7 +68,7 @@ static irqreturn_t pipe_interrupt(int irq, void *data) ...@@ -68,7 +68,7 @@ static irqreturn_t pipe_interrupt(int irq, void *data)
list_add(&conn->list, &conn->port->connections); list_add(&conn->list, &conn->port->connections);
complete(&conn->port->done); complete(&conn->port->done);
return(IRQ_HANDLED); return IRQ_HANDLED;
} }
#define NO_WAITER_MSG \ #define NO_WAITER_MSG \
...@@ -117,7 +117,7 @@ static int port_accept(struct port_list *port) ...@@ -117,7 +117,7 @@ static int port_accept(struct port_list *port)
printk("No one waiting for port\n"); printk("No one waiting for port\n");
} }
list_add(&conn->list, &port->pending); list_add(&conn->list, &port->pending);
return(1); return 1;
out_free: out_free:
kfree(conn); kfree(conn);
...@@ -126,7 +126,7 @@ static int port_accept(struct port_list *port) ...@@ -126,7 +126,7 @@ static int port_accept(struct port_list *port)
if(pid != -1) if(pid != -1)
os_kill_process(pid, 1); os_kill_process(pid, 1);
out: out:
return(ret); return ret;
} }
static DECLARE_MUTEX(ports_sem); static DECLARE_MUTEX(ports_sem);
...@@ -158,7 +158,7 @@ static irqreturn_t port_interrupt(int irq, void *data) ...@@ -158,7 +158,7 @@ static irqreturn_t port_interrupt(int irq, void *data)
port->has_connection = 1; port->has_connection = 1;
schedule_work(&port_work); schedule_work(&port_work);
return(IRQ_HANDLED); return IRQ_HANDLED;
} }
void *port_data(int port_num) void *port_data(int port_num)
...@@ -186,8 +186,8 @@ void *port_data(int port_num) ...@@ -186,8 +186,8 @@ void *port_data(int port_num)
goto out_free; goto out_free;
} }
if(um_request_irq(ACCEPT_IRQ, fd, IRQ_READ, port_interrupt, if(um_request_irq(ACCEPT_IRQ, fd, IRQ_READ, port_interrupt,
IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM, "port", IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM,
port)){ "port", port)){
printk(KERN_ERR "Failed to get IRQ for port %d\n", port_num); printk(KERN_ERR "Failed to get IRQ for port %d\n", port_num);
goto out_close; goto out_close;
} }
...@@ -222,7 +222,7 @@ void *port_data(int port_num) ...@@ -222,7 +222,7 @@ void *port_data(int port_num)
os_close_file(fd); os_close_file(fd);
out: out:
up(&ports_sem); up(&ports_sem);
return(dev); return dev;
} }
int port_wait(void *data) int port_wait(void *data)
......
...@@ -38,18 +38,18 @@ static void *port_init(char *str, int device, const struct chan_opts *opts) ...@@ -38,18 +38,18 @@ static void *port_init(char *str, int device, const struct chan_opts *opts)
if(*str != ':'){ if(*str != ':'){
printk("port_init : channel type 'port' must specify a " printk("port_init : channel type 'port' must specify a "
"port number\n"); "port number\n");
return(NULL); return NULL;
} }
str++; str++;
port = strtoul(str, &end, 0); port = strtoul(str, &end, 0);
if((*end != '\0') || (end == str)){ if((*end != '\0') || (end == str)){
printk("port_init : couldn't parse port '%s'\n", str); printk("port_init : couldn't parse port '%s'\n", str);
return(NULL); return NULL;
} }
kern_data = port_data(port); kern_data = port_data(port);
if(kern_data == NULL) if(kern_data == NULL)
return(NULL); return NULL;
data = um_kmalloc(sizeof(*data)); data = um_kmalloc(sizeof(*data));
if(data == NULL) if(data == NULL)
...@@ -59,10 +59,10 @@ static void *port_init(char *str, int device, const struct chan_opts *opts) ...@@ -59,10 +59,10 @@ static void *port_init(char *str, int device, const struct chan_opts *opts)
.kernel_data = kern_data }); .kernel_data = kern_data });
sprintf(data->dev, "%d", port); sprintf(data->dev, "%d", port);
return(data); return data;
err: err:
port_kern_free(kern_data); port_kern_free(kern_data);
return(NULL); return NULL;
} }
static void port_free(void *d) static void port_free(void *d)
...@@ -83,14 +83,14 @@ static int port_open(int input, int output, int primary, void *d, ...@@ -83,14 +83,14 @@ static int port_open(int input, int output, int primary, void *d,
if((fd >= 0) && data->raw){ if((fd >= 0) && data->raw){
CATCH_EINTR(err = tcgetattr(fd, &data->tt)); CATCH_EINTR(err = tcgetattr(fd, &data->tt));
if(err) if(err)
return(err); return err;
err = raw(fd); err = raw(fd);
if(err) if(err)
return(err); return err;
} }
*dev_out = data->dev; *dev_out = data->dev;
return(fd); return fd;
} }
static void port_close(int fd, void *d) static void port_close(int fd, void *d)
...@@ -121,7 +121,7 @@ int port_listen_fd(int port) ...@@ -121,7 +121,7 @@ int port_listen_fd(int port)
fd = socket(PF_INET, SOCK_STREAM, 0); fd = socket(PF_INET, SOCK_STREAM, 0);
if(fd == -1) if(fd == -1)
return(-errno); return -errno;
arg = 1; arg = 1;
if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &arg, sizeof(arg)) < 0){ if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &arg, sizeof(arg)) < 0){
...@@ -146,10 +146,10 @@ int port_listen_fd(int port) ...@@ -146,10 +146,10 @@ int port_listen_fd(int port)
if(err < 0) if(err < 0)
goto out; goto out;
return(fd); return fd;
out: out:
os_close_file(fd); os_close_file(fd);
return(err); return err;
} }
struct port_pre_exec_data { struct port_pre_exec_data {
...@@ -179,7 +179,7 @@ int port_connection(int fd, int *socket, int *pid_out) ...@@ -179,7 +179,7 @@ int port_connection(int fd, int *socket, int *pid_out)
new = os_accept_connection(fd); new = os_accept_connection(fd);
if(new < 0) if(new < 0)
return(new); return new;
err = os_pipe(socket, 0, 0); err = os_pipe(socket, 0, 0);
if(err < 0) if(err < 0)
...@@ -194,7 +194,7 @@ int port_connection(int fd, int *socket, int *pid_out) ...@@ -194,7 +194,7 @@ int port_connection(int fd, int *socket, int *pid_out)
goto out_shutdown; goto out_shutdown;
*pid_out = err; *pid_out = err;
return(new); return new;
out_shutdown: out_shutdown:
os_shutdown_socket(socket[0], 1, 1); os_shutdown_socket(socket[0], 1, 1);
...@@ -203,16 +203,5 @@ int port_connection(int fd, int *socket, int *pid_out) ...@@ -203,16 +203,5 @@ int port_connection(int fd, int *socket, int *pid_out)
os_close_file(socket[1]); os_close_file(socket[1]);
out_close: out_close:
os_close_file(new); 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:
*/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment