aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/pcap_kern.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-10-16 04:27:29 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:08 -0400
commitcd1ae0e49bdd814cfaa2e5ab28cff21a30e20085 (patch)
tree1b993b9de4cb9a8578022a4014063c3e87ec996e /arch/um/drivers/pcap_kern.c
parent1a80521990a0e30e61a92994a009adc52161b070 (diff)
uml: network formatting
Style and other non-functional changes in the UML networking code, including include tidying style violations copyright updates printks getting severities userspace code calling libc directly rather than using the os_* wrappers There's also a exit path cleanup in the pcap driver. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/drivers/pcap_kern.c')
-rw-r--r--arch/um/drivers/pcap_kern.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/arch/um/drivers/pcap_kern.c b/arch/um/drivers/pcap_kern.c
index c329931673d6..da0403efbc0d 100644
--- a/arch/um/drivers/pcap_kern.c
+++ b/arch/um/drivers/pcap_kern.c
@@ -1,13 +1,11 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike <jdike@karaya.com> 2 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL. 3 * Licensed under the GPL.
4 */ 4 */
5 5
6#include "linux/init.h" 6#include "linux/init.h"
7#include "linux/netdevice.h" 7#include <linux/netdevice.h>
8#include "linux/etherdevice.h"
9#include "net_kern.h" 8#include "net_kern.h"
10#include "net_user.h"
11#include "pcap_user.h" 9#include "pcap_user.h"
12 10
13struct pcap_init { 11struct pcap_init {
@@ -37,7 +35,7 @@ static int pcap_read(int fd, struct sk_buff **skb,
37 struct uml_net_private *lp) 35 struct uml_net_private *lp)
38{ 36{
39 *skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER); 37 *skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER);
40 if(*skb == NULL) 38 if (*skb == NULL)
41 return -ENOMEM; 39 return -ENOMEM;
42 40
43 return pcap_user_read(fd, skb_mac_header(*skb), 41 return pcap_user_read(fd, skb_mac_header(*skb),
@@ -71,28 +69,29 @@ int pcap_setup(char *str, char **mac_out, void *data)
71 69
72 remain = split_if_spec(str, &host_if, &init->filter, 70 remain = split_if_spec(str, &host_if, &init->filter,
73 &options[0], &options[1], mac_out, NULL); 71 &options[0], &options[1], mac_out, NULL);
74 if(remain != NULL){ 72 if (remain != NULL) {
75 printk(KERN_ERR "pcap_setup - Extra garbage on " 73 printk(KERN_ERR "pcap_setup - Extra garbage on "
76 "specification : '%s'\n", remain); 74 "specification : '%s'\n", remain);
77 return 0; 75 return 0;
78 } 76 }
79 77
80 if(host_if != NULL) 78 if (host_if != NULL)
81 init->host_if = host_if; 79 init->host_if = host_if;
82 80
83 for(i = 0; i < ARRAY_SIZE(options); i++){ 81 for (i = 0; i < ARRAY_SIZE(options); i++) {
84 if(options[i] == NULL) 82 if (options[i] == NULL)
85 continue; 83 continue;
86 if(!strcmp(options[i], "promisc")) 84 if (!strcmp(options[i], "promisc"))
87 init->promisc = 1; 85 init->promisc = 1;
88 else if(!strcmp(options[i], "nopromisc")) 86 else if (!strcmp(options[i], "nopromisc"))
89 init->promisc = 0; 87 init->promisc = 0;
90 else if(!strcmp(options[i], "optimize")) 88 else if (!strcmp(options[i], "optimize"))
91 init->optimize = 1; 89 init->optimize = 1;
92 else if(!strcmp(options[i], "nooptimize")) 90 else if (!strcmp(options[i], "nooptimize"))
93 init->optimize = 0; 91 init->optimize = 0;
94 else { 92 else {
95 printk("pcap_setup : bad option - '%s'\n", options[i]); 93 printk(KERN_ERR "pcap_setup : bad option - '%s'\n",
94 options[i]);
96 return 0; 95 return 0;
97 } 96 }
98 } 97 }