staging: bcm: Cleanup unneeded boolean comparisons

Cleans up a few needless comparisons with booleans and cleans up an
interupt handler to take advantage of earlier bailout shortcircuit.

Signed-off-by: Jade Bilkey <herself@thefumon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jade Bilkey 2014-03-17 19:45:28 -04:00 коммит произвёл Greg Kroah-Hartman
Родитель 6a259d9b7b
Коммит c6e50bafd0
1 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -12,14 +12,13 @@ static void read_int_callback(struct urb *urb/*, struct pt_regs *regs*/)
pr_info(PFX "%s: interrupt status %d\n", pr_info(PFX "%s: interrupt status %d\n",
Adapter->dev->name, status); Adapter->dev->name, status);
if (Adapter->device_removed == TRUE) { if (Adapter->device_removed) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT, BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT,
DBG_LVL_ALL, "Device has Got Removed."); DBG_LVL_ALL, "Device has Got Removed.");
return; return;
} }
if (((Adapter->bPreparingForLowPowerMode == TRUE) && if ((Adapter->bPreparingForLowPowerMode && Adapter->bDoSuspend) ||
(Adapter->bDoSuspend == TRUE)) ||
psIntfAdapter->bSuspended || psIntfAdapter->bSuspended ||
psIntfAdapter->bPreparingForBusSuspend) { psIntfAdapter->bPreparingForBusSuspend) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT, BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT,
@ -65,7 +64,7 @@ static void read_int_callback(struct urb *urb/*, struct pt_regs *regs*/)
psIntfAdapter->psAdapter->downloadDDR += 1; psIntfAdapter->psAdapter->downloadDDR += 1;
wake_up(&Adapter->tx_packet_wait_queue); wake_up(&Adapter->tx_packet_wait_queue);
} }
if (false == Adapter->waiting_to_fw_download_done) { if (!Adapter->waiting_to_fw_download_done) {
Adapter->waiting_to_fw_download_done = TRUE; Adapter->waiting_to_fw_download_done = TRUE;
wake_up(&Adapter->ioctl_fw_dnld_wait_queue); wake_up(&Adapter->ioctl_fw_dnld_wait_queue);
} }
@ -168,13 +167,13 @@ INT StartInterruptUrb(struct bcm_interface_adapter *psIntfAdapter)
{ {
INT status = 0; INT status = 0;
if (false == psIntfAdapter->psAdapter->device_removed && if (!(psIntfAdapter->psAdapter->device_removed ||
false == psIntfAdapter->psAdapter->bEndPointHalted && psIntfAdapter->psAdapter->bEndPointHalted ||
false == psIntfAdapter->bSuspended && psIntfAdapter->bSuspended ||
false == psIntfAdapter->bPreparingForBusSuspend && psIntfAdapter->bPreparingForBusSuspend ||
false == psIntfAdapter->psAdapter->StopAllXaction) { psIntfAdapter->psAdapter->StopAllXaction)) {
status = status =
usb_submit_urb(psIntfAdapter->psInterruptUrb, GFP_ATOMIC); usb_submit_urb(psIntfAdapter->psInterruptUrb, GFP_ATOMIC);
if (status) { if (status) {
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,
DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL, DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,