Staging: wlan-ng: More checkpatch.pl error cleanups

Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Andrew Elwell 2010-02-18 23:56:13 +01:00 committed by Greg Kroah-Hartman
parent ef1a0ed7f1
commit 3f4b4e7797
4 changed files with 28 additions and 25 deletions

View File

@ -1909,18 +1909,19 @@ int hfa384x_drvr_flashdl_enable(hfa384x_t *hw)
return -EINVAL; return -EINVAL;
/* Retrieve the buffer loc&size and timeout */ /* Retrieve the buffer loc&size and timeout */
if ((result = hfa384x_drvr_getconfig(hw, HFA384x_RID_DOWNLOADBUFFER, result = hfa384x_drvr_getconfig(hw, HFA384x_RID_DOWNLOADBUFFER,
&(hw->bufinfo), &(hw->bufinfo), sizeof(hw->bufinfo));
sizeof(hw->bufinfo)))) { if (result)
return result; return result;
}
hw->bufinfo.page = le16_to_cpu(hw->bufinfo.page); hw->bufinfo.page = le16_to_cpu(hw->bufinfo.page);
hw->bufinfo.offset = le16_to_cpu(hw->bufinfo.offset); hw->bufinfo.offset = le16_to_cpu(hw->bufinfo.offset);
hw->bufinfo.len = le16_to_cpu(hw->bufinfo.len); hw->bufinfo.len = le16_to_cpu(hw->bufinfo.len);
if ((result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_MAXLOADTIME, result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_MAXLOADTIME,
&(hw->dltimeout)))) { &(hw->dltimeout));
if (result)
return result; return result;
}
hw->dltimeout = le16_to_cpu(hw->dltimeout); hw->dltimeout = le16_to_cpu(hw->dltimeout);
pr_debug("flashdl_enable\n"); pr_debug("flashdl_enable\n");
@ -3071,9 +3072,9 @@ static void hfa384x_usbctlxq_run(hfa384x_t *hw)
hfa384x_ctlxout_callback, hw); hfa384x_ctlxout_callback, hw);
hw->ctlx_urb.transfer_flags |= USB_QUEUE_BULK; hw->ctlx_urb.transfer_flags |= USB_QUEUE_BULK;
/* Now submit the URB and update the CTLX's state /* Now submit the URB and update the CTLX's state */
*/ result = SUBMIT_URB(&hw->ctlx_urb, GFP_ATOMIC);
if ((result = SUBMIT_URB(&hw->ctlx_urb, GFP_ATOMIC)) == 0) { if (result == 0) {
/* This CTLX is now running on the active queue */ /* This CTLX is now running on the active queue */
head->state = CTLX_REQ_SUBMITTED; head->state = CTLX_REQ_SUBMITTED;
@ -3599,7 +3600,8 @@ static void hfa384x_int_rxmonitor(wlandevice_t *wlandev,
skblen - sizeof(p80211_caphdr_t)); skblen - sizeof(p80211_caphdr_t));
} }
if ((skb = dev_alloc_skb(skblen)) == NULL) { skb = dev_alloc_skb(skblen);
if (skb == NULL) {
printk(KERN_ERR printk(KERN_ERR
"alloc_skb failed trying to allocate %d bytes\n", "alloc_skb failed trying to allocate %d bytes\n",
skblen); skblen);
@ -3870,9 +3872,9 @@ retry:
delresp: delresp:
if (delete_resptimer) { if (delete_resptimer) {
if ((timer_ok = del_timer(&hw->resptimer)) != 0) { timer_ok = del_timer(&hw->resptimer);
if (timer_ok != 0)
hw->resp_timer_done = 1; hw->resp_timer_done = 1;
}
} }
spin_unlock_irqrestore(&hw->ctlxq.lock, flags); spin_unlock_irqrestore(&hw->ctlxq.lock, flags);

View File

@ -207,11 +207,10 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
p80211_wep->data = kmalloc(skb->len, GFP_ATOMIC); p80211_wep->data = kmalloc(skb->len, GFP_ATOMIC);
if ((foo = wep_encrypt(wlandev, skb->data, p80211_wep->data, foo = wep_encrypt(wlandev, skb->data, p80211_wep->data,
skb->len, skb->len, (wlandev->hostwep &HOSTWEP_DEFAULTKEY_MASK),
(wlandev->hostwep & p80211_wep->iv, p80211_wep->icv);
HOSTWEP_DEFAULTKEY_MASK), if (foo) {
p80211_wep->iv, p80211_wep->icv))) {
printk(KERN_WARNING printk(KERN_WARNING
"Host en-WEP failed, dropping frame (%d).\n", "Host en-WEP failed, dropping frame (%d).\n",
foo); foo);
@ -323,11 +322,12 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
skb->len); skb->len);
return 1; return 1;
} }
if ((foo = wep_decrypt(wlandev, skb->data + payload_offset + 4, foo = wep_decrypt(wlandev, skb->data + payload_offset + 4,
payload_length - 8, -1, payload_length - 8, -1,
skb->data + payload_offset, skb->data + payload_offset,
skb->data + payload_offset + skb->data + payload_offset +
payload_length - 4))) { payload_length - 4);
if (foo) {
/* de-wep failed, drop skb. */ /* de-wep failed, drop skb. */
pr_debug("Host de-WEP failed, dropping frame (%d).\n", pr_debug("Host de-WEP failed, dropping frame (%d).\n",
foo); foo);

View File

@ -586,7 +586,8 @@ static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd)
} }
/* Allocate a buf of size req->len */ /* Allocate a buf of size req->len */
if ((msgbuf = kmalloc(req->len, GFP_KERNEL))) { msgbuf = kmalloc(req->len, GFP_KERNEL);
if (msgbuf) {
if (copy_from_user(msgbuf, (void __user *)req->data, req->len)) if (copy_from_user(msgbuf, (void __user *)req->data, req->len))
result = -EFAULT; result = -EFAULT;
else else

View File

@ -549,14 +549,14 @@ static int p80211wext_siwencode(netdevice_t *dev,
} }
/* Check the Key index first. */ /* Check the Key index first. */
if ((i = (erq->flags & IW_ENCODE_INDEX))) { i = (erq->flags & IW_ENCODE_INDEX);
if (i) {
if ((i < 1) || (i > NUM_WEPKEYS)) { if ((i < 1) || (i > NUM_WEPKEYS)) {
err = -EINVAL; err = -EINVAL;
goto exit; goto exit;
} else } else {
i--; i--;
}
/* Set current key number only if no keys are given */ /* Set current key number only if no keys are given */
if (erq->flags & IW_ENCODE_NOKEY) { if (erq->flags & IW_ENCODE_NOKEY) {
result = result =