uml: driver formatting fixes

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=56bd194bb200ef0c49517de67a7d7f4b043b11b1
Commit: 56bd194bb200ef0c49517de67a7d7f4b043b11b1
Parent: b47d2debf229469c78af4145ee7ad35a0f21b67f
Author: Jeff Dike <[EMAIL PROTECTED]>
AuthorDate: Sun May 6 14:51:02 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon May 7 12:13:00 2007 -0700

    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 <[EMAIL PROTECTED]>
Cc: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/um/drivers/chan_user.c  |2 +-
 arch/um/drivers/daemon_user.c|   25 +-
 arch/um/drivers/mcast_user.c |   12 
 arch/um/drivers/pcap_user.c  |   33 
 arch/um/drivers/ubd_user.c   |   15 +-
 arch/um/os-Linux/drivers/ethertap_user.c |   36 ++
 arch/um/os-Linux/drivers/tuntap_user.c   |   40 --
 7 files changed, 57 insertions(+), 106 deletions(-)

diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
index 0cad354..77d3fdb 100644
--- a/arch/um/drivers/chan_user.c
+++ b/arch/um/drivers/chan_user.c
@@ -158,7 +158,7 @@ static int winch_tramp(int fd, struct tty_struct *tty, int 
*fd_out)
 */
err = run_helper_thread(winch_thread, &data, CLONE_FILES, &stack, 0);
if(err < 0){
-   printk("fork of winch_thread failed - errno = %d\n", errno);
+   printk("fork of winch_thread failed - errno = %d\n", err);
goto out_close;
}
 
diff --git a/arch/um/drivers/daemon_user.c b/arch/um/drivers/daemon_user.c
index 021b82c..09d1de9 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)
sun = um_kmalloc(sizeof(struct sockaddr_un));
if(sun == NULL){
printk("new_addr: allocation of sockaddr_un failed\n");
-   return(NULL);
+   return NULL;
}
sun->sun_family = AF_UNIX;
memcpy(sun->sun_path, name, len);
-   return(sun);
+   return sun;
 }
 
 static int connect_to_switch(struct daemon_data *pri)
@@ -112,7 +112,7 @@ static int connect_to_switch(struct daemon_data *pri)
}
 
pri->data_addr = sun;
-   return(fd);
+   return fd;
 
  out_free:
kfree(sun);
@@ -120,7 +120,7 @@ static int connect_to_switch(struct daemon_data *pri)
os_close_file(fd);
  out:
os_close_file(pri->control);
-   return(err);
+   return err;
 }
 
 static void daemon_user_init(void *data, void *dev)
@@ -152,7 +152,7 @@ static void daemon_user_init(void *data, void *dev)
 static int daemon_open(void *data)
 {
struct daemon_data *pri = data;
-   return(pri->fd);
+   return pri->fd;
 }
 
 static void daemon_remove(void *data)
@@ -176,12 +176,12 @@ int daemon_user_write(int fd, void *buf, int len, struct 
daemon_data *pri)
 {
struct sockaddr_un *data_addr = pri->data_addr;
 
-   return(net_sendto(fd, buf, len, data_addr, sizeof(*data_addr)));
+   return net_sendto(fd, buf, len, data_addr, sizeof(*data_addr));
 }
 
 static int daemon_set_mtu(int mtu, void *data)
 {
-   return(mtu);
+   return mtu;
 }
 
 const struct net_user_info daemon_user_info = {
@@ -194,14 +194,3 @@ const struct net_user_info daemon_user_info = {
.delete_address = NULL,
.max_packet = MAX_PACKET - ETH_HEADER_OTHER
 };
-
-/*
- * 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:
- */
diff --git a/arch/um/drivers/mcast_user.c b/arch/um/drivers/mcast_user.c
index b827e82..cfaa2cc 100644
--- a/arch/um/drivers/mcast_user.c
+++ b/arch/um/drivers/mcast_user.c
@@ -34,12 +34,12 @@ static struct sockaddr_in *new_addr(char *addr, unsigned 
short port)
sin = um_kmalloc(sizeof(struct sockaddr_in));
if(sin == NULL){
printk("new_addr: allocatio

uml-driver-formatting-fixes-fix

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b16895b63c504698b0c3ab26ca3c41a4fa162a42
Commit: b16895b63c504698b0c3ab26ca3c41a4fa162a42
Parent: 56bd194bb200ef0c49517de67a7d7f4b043b11b1
Author: Andrew Morton <[EMAIL PROTECTED]>
AuthorDate: Sun May 6 14:51:03 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon May 7 12:13:00 2007 -0700

    uml-driver-formatting-fixes-fix

Cc: Jeff Dike <[EMAIL PROTECTED]>
Cc: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/um/drivers/chan_user.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
index 77d3fdb..ed24eab 100644
--- a/arch/um/drivers/chan_user.c
+++ b/arch/um/drivers/chan_user.c
@@ -158,7 +158,7 @@ static int winch_tramp(int fd, struct tty_struct *tty, int 
*fd_out)
 */
err = run_helper_thread(winch_thread, &data, CLONE_FILES, &stack, 0);
if(err < 0){
-   printk("fork of winch_thread failed - errno = %d\n", err);
+   printk("fork of winch_thread failed - errno = %d\n", -err);
goto out_close;
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html