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>
This commit is contained in:
Jeff Dike
2007-10-16 01:27:29 -07:00
committed by Linus Torvalds
parent 1a80521990
commit cd1ae0e49b
22 changed files with 607 additions and 621 deletions

View File

@@ -1,16 +1,15 @@
/*
* Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org) and
* Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org) and
* James Leu (jleu@mindspring.net).
* Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
* Copyright (C) 2001 by various other people who didn't put their name here.
* Licensed under the GPL.
*/
#include "linux/init.h"
#include "linux/netdevice.h"
#include "linux/etherdevice.h"
#include "net_kern.h"
#include "net_user.h"
#include <linux/netdevice.h>
#include "etap.h"
#include "net_kern.h"
struct ethertap_init {
char *dev_name;
@@ -42,27 +41,30 @@ static int etap_read(int fd, struct sk_buff **skb, struct uml_net_private *lp)
int len;
*skb = ether_adjust_skb(*skb, ETH_HEADER_ETHERTAP);
if(*skb == NULL) return(-ENOMEM);
if (*skb == NULL)
return -ENOMEM;
len = net_recvfrom(fd, skb_mac_header(*skb),
(*skb)->dev->mtu + 2 * ETH_HEADER_ETHERTAP);
if(len <= 0) return(len);
if (len <= 0)
return len;
skb_pull(*skb, 2);
len -= 2;
return(len);
return len;
}
static int etap_write(int fd, struct sk_buff **skb, struct uml_net_private *lp)
{
if(skb_headroom(*skb) < 2){
if (skb_headroom(*skb) < 2) {
struct sk_buff *skb2;
skb2 = skb_realloc_headroom(*skb, 2);
dev_kfree_skb(*skb);
if (skb2 == NULL) return(-ENOMEM);
if (skb2 == NULL)
return -ENOMEM;
*skb = skb2;
}
skb_push(*skb, 2);
return(net_send(fd, (*skb)->data, (*skb)->len));
return net_send(fd, (*skb)->data, (*skb)->len);
}
const struct net_kern_info ethertap_kern_info = {
@@ -79,15 +81,15 @@ int ethertap_setup(char *str, char **mac_out, void *data)
*init = ((struct ethertap_init)
{ .dev_name = NULL,
.gate_addr = NULL });
if(tap_setup_common(str, "ethertap", &init->dev_name, mac_out,
if (tap_setup_common(str, "ethertap", &init->dev_name, mac_out,
&init->gate_addr))
return(0);
if(init->dev_name == NULL){
printk("ethertap_setup : Missing tap device name\n");
return(0);
return 0;
if (init->dev_name == NULL) {
printk(KERN_ERR "ethertap_setup : Missing tap device name\n");
return 0;
}
return(1);
return 1;
}
static struct transport ethertap_transport = {