aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/daemon_user.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-05-06 17:51:02 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:13:00 -0400
commit56bd194bb200ef0c49517de67a7d7f4b043b11b1 (patch)
tree2c180ee0e18e0e18b997a8a14d84505f0388f1c7 /arch/um/drivers/daemon_user.c
parentb47d2debf229469c78af4145ee7ad35a0f21b67f (diff)
uml: driver formatting fixes
Fix a bunch of formatting violations in the drivers: return(n) -> return n whitespace fixes emacs formatting comment removal breaking if(foo) return(n) into two lines There are also a couple of errno use bugs: using errno in a printk when the failure put errno into a local variable saving errno after a printk, which can change it Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/drivers/daemon_user.c')
-rw-r--r--arch/um/drivers/daemon_user.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/arch/um/drivers/daemon_user.c b/arch/um/drivers/daemon_user.c
index 021b82c7a75..09d1de90297 100644
--- a/arch/um/drivers/daemon_user.c
+++ b/arch/um/drivers/daemon_user.c
@@ -39,11 +39,11 @@ static struct sockaddr_un *new_addr(void *name, int len)
39 sun = um_kmalloc(sizeof(struct sockaddr_un)); 39 sun = um_kmalloc(sizeof(struct sockaddr_un));
40 if(sun == NULL){ 40 if(sun == NULL){
41 printk("new_addr: allocation of sockaddr_un failed\n"); 41 printk("new_addr: allocation of sockaddr_un failed\n");
42 return(NULL); 42 return NULL;
43 } 43 }
44 sun->sun_family = AF_UNIX; 44 sun->sun_family = AF_UNIX;
45 memcpy(sun->sun_path, name, len); 45 memcpy(sun->sun_path, name, len);
46 return(sun); 46 return sun;
47} 47}
48 48
49static int connect_to_switch(struct daemon_data *pri) 49static int connect_to_switch(struct daemon_data *pri)
@@ -112,7 +112,7 @@ static int connect_to_switch(struct daemon_data *pri)
112 } 112 }
113 113
114 pri->data_addr = sun; 114 pri->data_addr = sun;
115 return(fd); 115 return fd;
116 116
117 out_free: 117 out_free:
118 kfree(sun); 118 kfree(sun);
@@ -120,7 +120,7 @@ static int connect_to_switch(struct daemon_data *pri)
120 os_close_file(fd); 120 os_close_file(fd);
121 out: 121 out:
122 os_close_file(pri->control); 122 os_close_file(pri->control);
123 return(err); 123 return err;
124} 124}
125 125
126static void daemon_user_init(void *data, void *dev) 126static void daemon_user_init(void *data, void *dev)
@@ -152,7 +152,7 @@ static void daemon_user_init(void *data, void *dev)
152static int daemon_open(void *data) 152static int daemon_open(void *data)
153{ 153{
154 struct daemon_data *pri = data; 154 struct daemon_data *pri = data;
155 return(pri->fd); 155 return pri->fd;
156} 156}
157 157
158static void daemon_remove(void *data) 158static void daemon_remove(void *data)
@@ -176,12 +176,12 @@ int daemon_user_write(int fd, void *buf, int len, struct daemon_data *pri)
176{ 176{
177 struct sockaddr_un *data_addr = pri->data_addr; 177 struct sockaddr_un *data_addr = pri->data_addr;
178 178
179 return(net_sendto(fd, buf, len, data_addr, sizeof(*data_addr))); 179 return net_sendto(fd, buf, len, data_addr, sizeof(*data_addr));
180} 180}
181 181
182static int daemon_set_mtu(int mtu, void *data) 182static int daemon_set_mtu(int mtu, void *data)
183{ 183{
184 return(mtu); 184 return mtu;
185} 185}
186 186
187const struct net_user_info daemon_user_info = { 187const struct net_user_info daemon_user_info = {
@@ -194,14 +194,3 @@ const struct net_user_info daemon_user_info = {
194 .delete_address = NULL, 194 .delete_address = NULL,
195 .max_packet = MAX_PACKET - ETH_HEADER_OTHER 195 .max_packet = MAX_PACKET - ETH_HEADER_OTHER
196}; 196};
197
198/*
199 * Overrides for Emacs so that we follow Linus's tabbing style.
200 * Emacs will notice this stuff at the end of the file and automatically
201 * adjust the settings for this buffer only. This must remain at the end
202 * of the file.
203 * ---------------------------------------------------------------------------
204 * Local variables:
205 * c-file-style: "linux"
206 * End:
207 */