Commit 253804a2 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: ath6kl: cleanup in SEND_FRAME ioctl

The original code was written in a funny way where every statement was
part of else if blocks.  I broke them up into separate statements by
adding breaks on failure conditions.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarVipin Mehta <vipin.mehta@atheros.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 108160db
...@@ -3167,24 +3167,26 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -3167,24 +3167,26 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
if (ar->arWmiReady == false) { if (ar->arWmiReady == false) {
ret = -EIO; ret = -EIO;
} else if (copy_from_user(&optTxFrmCmd, userdata, break;
sizeof(optTxFrmCmd))) }
{
if (copy_from_user(&optTxFrmCmd, userdata, sizeof(optTxFrmCmd))) {
ret = -EFAULT; ret = -EFAULT;
} else if (copy_from_user(data, break;
userdata+sizeof(WMI_OPT_TX_FRAME_CMD)-1, }
optTxFrmCmd.optIEDataLen))
{ if (copy_from_user(data, userdata+sizeof(WMI_OPT_TX_FRAME_CMD) - 1,
optTxFrmCmd.optIEDataLen)) {
ret = -EFAULT; ret = -EFAULT;
} else { break;
}
ret = wmi_opt_tx_frame_cmd(ar->arWmi, ret = wmi_opt_tx_frame_cmd(ar->arWmi,
optTxFrmCmd.frmType, optTxFrmCmd.frmType,
optTxFrmCmd.dstAddr, optTxFrmCmd.dstAddr,
optTxFrmCmd.bssid, optTxFrmCmd.bssid,
optTxFrmCmd.optIEDataLen, optTxFrmCmd.optIEDataLen,
data); data);
}
break; break;
} }
case AR6000_XIOCTL_WMI_SETRETRYLIMITS: case AR6000_XIOCTL_WMI_SETRETRYLIMITS:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment