Commit 77121d52 authored by Kevin McKinney's avatar Kevin McKinney Committed by Greg Kroah-Hartman

Staging: bcm: Remove unnecessary "do while" statement in, IOCTL_BCM_BUFFER_DOWNLOAD

This patch removes a superfluous "do while"
statement in IOCTL_BCM_BUFFER_DOWNLOAD.
Signed-off-by: default avatarKevin McKinney <klmckinney1@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 51935d22
...@@ -792,59 +792,56 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -792,59 +792,56 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
case IOCTL_BCM_BUFFER_DOWNLOAD: { case IOCTL_BCM_BUFFER_DOWNLOAD: {
FIRMWARE_INFO *psFwInfo = NULL; FIRMWARE_INFO *psFwInfo = NULL;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Starting the firmware download PID =0x%x!!!!\n", current->pid); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Starting the firmware download PID =0x%x!!!!\n", current->pid);
do {
if (!down_trylock(&Adapter->fw_download_sema)) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
"Invalid way to download buffer. Use Start and then call this!!!\n");
Status = -EINVAL;
break;
}
/* Copy Ioctl Buffer structure */
if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
return -EFAULT;
if (!down_trylock(&Adapter->fw_download_sema)) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
"Length for FW DLD is : %lx\n", IoBuffer.InputLength); "Invalid way to download buffer. Use Start and then call this!!!\n");
Status = -EINVAL;
break;
}
if (IoBuffer.InputLength > sizeof(FIRMWARE_INFO)) /* Copy Ioctl Buffer structure */
return -EINVAL; if (copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
return -EFAULT;
psFwInfo = kmalloc(sizeof(*psFwInfo), GFP_KERNEL); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
if (!psFwInfo) "Length for FW DLD is : %lx\n", IoBuffer.InputLength);
return -ENOMEM;
if (copy_from_user(psFwInfo, IoBuffer.InputBuffer, IoBuffer.InputLength)) if (IoBuffer.InputLength > sizeof(FIRMWARE_INFO))
return -EFAULT; return -EINVAL;
if (!psFwInfo->pvMappedFirmwareAddress || psFwInfo = kmalloc(sizeof(*psFwInfo), GFP_KERNEL);
(psFwInfo->u32FirmwareLength == 0)) { if (!psFwInfo)
return -ENOMEM;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Something else is wrong %lu\n", if (copy_from_user(psFwInfo, IoBuffer.InputBuffer, IoBuffer.InputLength))
psFwInfo->u32FirmwareLength); return -EFAULT;
Status = -EINVAL;
break;
}
Status = bcm_ioctl_fw_download(Adapter, psFwInfo); if (!psFwInfo->pvMappedFirmwareAddress ||
(psFwInfo->u32FirmwareLength == 0)) {
if (Status != STATUS_SUCCESS) { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Something else is wrong %lu\n",
if (psFwInfo->u32StartingAddress == CONFIG_BEGIN_ADDR) psFwInfo->u32FirmwareLength);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "IOCTL: Configuration File Upload Failed\n"); Status = -EINVAL;
else break;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "IOCTL: Firmware File Upload Failed\n"); }
/* up(&Adapter->fw_download_sema); */ Status = bcm_ioctl_fw_download(Adapter, psFwInfo);
if (Adapter->LEDInfo.led_thread_running & BCM_LED_THREAD_RUNNING_ACTIVELY) { if (Status != STATUS_SUCCESS) {
Adapter->DriverState = DRIVER_INIT; if (psFwInfo->u32StartingAddress == CONFIG_BEGIN_ADDR)
Adapter->LEDInfo.bLedInitDone = FALSE; BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "IOCTL: Configuration File Upload Failed\n");
wake_up(&Adapter->LEDInfo.notify_led_event); else
} BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "IOCTL: Firmware File Upload Failed\n");
}
break; /* up(&Adapter->fw_download_sema); */
} while (0); if (Adapter->LEDInfo.led_thread_running & BCM_LED_THREAD_RUNNING_ACTIVELY) {
Adapter->DriverState = DRIVER_INIT;
Adapter->LEDInfo.bLedInitDone = FALSE;
wake_up(&Adapter->LEDInfo.notify_led_event);
}
}
if (Status != STATUS_SUCCESS) if (Status != STATUS_SUCCESS)
up(&Adapter->fw_download_sema); up(&Adapter->fw_download_sema);
......
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