aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-14 09:31:19 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-14 09:31:19 -0700
commitab3c556de19b1888b0830ef066524884d4788131 (patch)
tree7652961084c69e00267eda767edeeac5e20aed51 /drivers/net
parentc4e7ac5d427a48b91752671523f39a04e63e12ff (diff)
parentcae7ca3d3de48851e929de9469397749638df779 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [IPVS]: Use IP_VS_WAIT_WHILE when encessary. [NET]: Share correct feature code between bridging and bonding [ATM] drivers/atm/iphase.c: mostly kmalloc + memset conversion to kzalloc [IRDA] irda-usb.c: mostly kmalloc + memset conversion to k[cz]alloc [WAN] drivers/net/wan/hdlc_fr.c: kmalloc + memset conversion to kzalloc [DCCP]: fix memory leak and clean up style - dccp_feat_empty_confirm() [DCCP]: fix theoretical ccids_{read,write}_lock() race [XFRM]: Clean up duplicate includes in net/xfrm/ [TIPC]: Clean up duplicate includes in net/tipc/ [SUNRPC]: Clean up duplicate includes in net/sunrpc/ [PKT_SCHED]: Clean up duplicate includes in net/sched/ [IPV6]: Clean up duplicate includes in net/ipv6/ [IPV4]: Clean up duplicate includes in net/ipv4/ [ATM]: Clean up duplicate includes in net/atm/ [ATM]: Clean up duplicate includes in drivers/atm/ [IPCONFIG]: ip_auto_config fix [ATM]: fore200e_param_bs_queue() must be __devinit
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bonding/bond_main.c34
-rw-r--r--drivers/net/irda/irda-usb.c24
-rw-r--r--drivers/net/wan/hdlc_fr.c3
3 files changed, 24 insertions, 37 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 070b78d959c..1afda3230de 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1202,43 +1202,35 @@ static int bond_sethwaddr(struct net_device *bond_dev,
return 0;
}
-#define BOND_INTERSECT_FEATURES \
- (NETIF_F_SG | NETIF_F_ALL_CSUM | NETIF_F_TSO | NETIF_F_UFO)
+#define BOND_VLAN_FEATURES \
+ (NETIF_F_VLAN_CHALLENGED | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX | \
+ NETIF_F_HW_VLAN_FILTER)
/*
* Compute the common dev->feature set available to all slaves. Some
- * feature bits are managed elsewhere, so preserve feature bits set on
- * master device that are not part of the examined set.
+ * feature bits are managed elsewhere, so preserve those feature bits
+ * on the master device.
*/
static int bond_compute_features(struct bonding *bond)
{
- unsigned long features = BOND_INTERSECT_FEATURES;
struct slave *slave;
struct net_device *bond_dev = bond->dev;
+ unsigned long features = bond_dev->features;
unsigned short max_hard_header_len = ETH_HLEN;
int i;
+ features &= ~(NETIF_F_ALL_CSUM | BOND_VLAN_FEATURES);
+ features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
+ NETIF_F_GSO_MASK | NETIF_F_NO_CSUM;
+
bond_for_each_slave(bond, slave, i) {
- features &= (slave->dev->features & BOND_INTERSECT_FEATURES);
+ features = netdev_compute_features(features,
+ slave->dev->features);
if (slave->dev->hard_header_len > max_hard_header_len)
max_hard_header_len = slave->dev->hard_header_len;
}
- if ((features & NETIF_F_SG) &&
- !(features & NETIF_F_ALL_CSUM))
- features &= ~NETIF_F_SG;
-
- /*
- * features will include NETIF_F_TSO (NETIF_F_UFO) iff all
- * slave devices support NETIF_F_TSO (NETIF_F_UFO), which
- * implies that all slaves also support scatter-gather
- * (NETIF_F_SG), which implies that features also includes
- * NETIF_F_SG. So no need to check whether we have an
- * illegal combination of NETIF_F_{TSO,UFO} and
- * !NETIF_F_SG
- */
-
- features |= (bond_dev->features & ~BOND_INTERSECT_FEATURES);
+ features |= (bond_dev->features & BOND_VLAN_FEATURES);
bond_dev->features = features;
bond_dev->hard_header_len = max_hard_header_len;
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 0ac240ca905..3b0fd83fa26 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -1561,10 +1561,9 @@ static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_interf
struct irda_class_desc *desc;
int ret;
- desc = kmalloc(sizeof (*desc), GFP_KERNEL);
- if (desc == NULL)
+ desc = kzalloc(sizeof(*desc), GFP_KERNEL);
+ if (!desc)
return NULL;
- memset(desc, 0, sizeof(*desc));
/* USB-IrDA class spec 1.0:
* 6.1.3: Standard "Get Descriptor" Device Request is not
@@ -1617,7 +1616,7 @@ static int irda_usb_probe(struct usb_interface *intf,
{
struct net_device *net;
struct usb_device *dev = interface_to_usbdev(intf);
- struct irda_usb_cb *self = NULL;
+ struct irda_usb_cb *self;
struct usb_host_interface *interface;
struct irda_class_desc *irda_desc;
int ret = -ENOMEM;
@@ -1655,7 +1654,7 @@ static int irda_usb_probe(struct usb_interface *intf,
self->header_length = USB_IRDA_HEADER;
}
- self->rx_urb = kzalloc(self->max_rx_urb * sizeof(struct urb *),
+ self->rx_urb = kcalloc(self->max_rx_urb, sizeof(struct urb *),
GFP_KERNEL);
for (i = 0; i < self->max_rx_urb; i++) {
@@ -1715,7 +1714,7 @@ static int irda_usb_probe(struct usb_interface *intf,
/* Find IrDA class descriptor */
irda_desc = irda_usb_find_class_desc(intf);
ret = -ENODEV;
- if (irda_desc == NULL)
+ if (!irda_desc)
goto err_out_3;
if (self->needspatch) {
@@ -1738,15 +1737,13 @@ static int irda_usb_probe(struct usb_interface *intf,
/* Don't change this buffer size and allocation without doing
* some heavy and complete testing. Don't ask why :-(
* Jean II */
- self->speed_buff = kmalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
- if (self->speed_buff == NULL)
+ self->speed_buff = kzalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
+ if (!self->speed_buff)
goto err_out_3;
- memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU);
-
self->tx_buff = kzalloc(IRDA_SKB_MAX_MTU + self->header_length,
GFP_KERNEL);
- if (self->tx_buff == NULL)
+ if (!self->tx_buff)
goto err_out_4;
ret = irda_usb_open(self);
@@ -1767,12 +1764,11 @@ static int irda_usb_probe(struct usb_interface *intf,
/* replace IrDA class descriptor with what patched device is now reporting */
irda_desc = irda_usb_find_class_desc (self->usbintf);
- if (irda_desc == NULL) {
+ if (!irda_desc) {
ret = -ENODEV;
goto err_out_6;
}
- if (self->irda_desc)
- kfree (self->irda_desc);
+ kfree(self->irda_desc);
self->irda_desc = irda_desc;
irda_usb_init_qos(self);
}
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index 15b6e07a438..071a64cacd5 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -212,14 +212,13 @@ static pvc_device* add_pvc(struct net_device *dev, u16 dlci)
pvc_p = &(*pvc_p)->next;
}
- pvc = kmalloc(sizeof(pvc_device), GFP_ATOMIC);
+ pvc = kzalloc(sizeof(pvc_device), GFP_ATOMIC);
#ifdef DEBUG_PVC
printk(KERN_DEBUG "add_pvc: allocated pvc %p, frad %p\n", pvc, dev);
#endif
if (!pvc)
return NULL;
- memset(pvc, 0, sizeof(pvc_device));
pvc->dlci = dlci;
pvc->frad = dev;
pvc->next = *pvc_p; /* Put it in the chain */