wireless: Remove unnecessary alloc/OOM messages, alloc cleanups
alloc failures already get standardized OOM messages and a dump_stack. Convert kzalloc's with multiplies to kcalloc. Convert kmalloc's with multiplies to kmalloc_array. Remove now unused variables. Remove unnecessary memset after kzalloc->kcalloc. Whitespace cleanups for these changes. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
9d11bd1592
commit
0d2e7a5c60
@@ -853,12 +853,8 @@ void __orinoco_ev_rx(struct net_device *dev, struct hermes *hw)
|
||||
int err;
|
||||
|
||||
desc = kmalloc(sizeof(*desc), GFP_ATOMIC);
|
||||
if (!desc) {
|
||||
printk(KERN_WARNING
|
||||
"%s: Can't allocate space for RX descriptor\n",
|
||||
dev->name);
|
||||
if (!desc)
|
||||
goto update_stats;
|
||||
}
|
||||
|
||||
rxfid = hermes_read_regn(hw, RXFID);
|
||||
|
||||
@@ -1336,10 +1332,9 @@ static void qbuf_scan(struct orinoco_private *priv, void *buf,
|
||||
unsigned long flags;
|
||||
|
||||
sd = kmalloc(sizeof(*sd), GFP_ATOMIC);
|
||||
if (!sd) {
|
||||
printk(KERN_ERR "%s: failed to alloc memory\n", __func__);
|
||||
if (!sd)
|
||||
return;
|
||||
}
|
||||
|
||||
sd->buf = buf;
|
||||
sd->len = len;
|
||||
sd->type = type;
|
||||
@@ -1357,10 +1352,9 @@ static void qabort_scan(struct orinoco_private *priv)
|
||||
unsigned long flags;
|
||||
|
||||
sd = kmalloc(sizeof(*sd), GFP_ATOMIC);
|
||||
if (!sd) {
|
||||
printk(KERN_ERR "%s: failed to alloc memory\n", __func__);
|
||||
if (!sd)
|
||||
return;
|
||||
}
|
||||
|
||||
sd->len = -1; /* Abort */
|
||||
|
||||
spin_lock_irqsave(&priv->scan_lock, flags);
|
||||
|
Reference in New Issue
Block a user