Commit 423e118c authored by Davis Abubakr-Sadik Nii Nai's avatar Davis Abubakr-Sadik Nii Nai Committed by Greg Kroah-Hartman

Staging: csr: fix indentation style issue in bh.c

This is a patch to the bh.c file that fixes up all indentation errors
found the checkpatch.pl tool. Two lines beyond 80 characters are left
alone to improve readability
Signed-off-by: default avatarDavis Abubakr-Sadik Nii Nai <dwa2pac@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 78a650dc
...@@ -241,67 +241,72 @@ static int bh_thread_function(void *arg) ...@@ -241,67 +241,72 @@ static int bh_thread_function(void *arg)
this_thread = &priv->bh_thread; this_thread = &priv->bh_thread;
t = timeout = 0; t = timeout = 0;
while (!kthread_should_stop()) { while (!kthread_should_stop()) {
/* wait until an error occurs, or we need to process something. */ /*
unifi_trace(priv, UDBG3, "bh_thread goes to sleep.\n"); * wait until an error occurs,
* or we need to process something.
if (timeout > 0) { */
/* Convert t in ms to jiffies */ unifi_trace(priv, UDBG3, "bh_thread goes to sleep.\n");
t = msecs_to_jiffies(timeout);
ret = wait_event_interruptible_timeout(this_thread->wakeup_q, if (timeout > 0) {
(this_thread->wakeup_flag && !this_thread->block_thread) || /* Convert t in ms to jiffies */
kthread_should_stop(), t = msecs_to_jiffies(timeout);
t); ret = wait_event_interruptible_timeout(
timeout = (ret > 0) ? jiffies_to_msecs(ret) : 0; this_thread->wakeup_q,
} else { (this_thread->wakeup_flag && !this_thread->block_thread) ||
ret = wait_event_interruptible(this_thread->wakeup_q, kthread_should_stop(),
(this_thread->wakeup_flag && !this_thread->block_thread) || t);
kthread_should_stop()); timeout = (ret > 0) ? jiffies_to_msecs(ret) : 0;
} } else {
ret = wait_event_interruptible(this_thread->wakeup_q,
if (kthread_should_stop()) { (this_thread->wakeup_flag && !this_thread->block_thread) ||
unifi_trace(priv, UDBG2, "bh_thread: signalled to exit\n"); kthread_should_stop());
break; }
}
if (kthread_should_stop()) {
if (ret < 0) { unifi_trace(priv, UDBG2,
unifi_notice(priv, "bh_thread: signalled to exit\n");
"bh_thread: wait_event returned %d, thread will exit\n", break;
ret); }
uf_wait_for_thread_to_stop(priv, this_thread);
break; if (ret < 0) {
} unifi_notice(priv,
"bh_thread: wait_event returned %d, thread will exit\n",
this_thread->wakeup_flag = 0; ret);
uf_wait_for_thread_to_stop(priv, this_thread);
unifi_trace(priv, UDBG3, "bh_thread calls unifi_bh().\n"); break;
}
CsrSdioClaim(priv->sdio);
csrResult = unifi_bh(priv->card, &timeout); this_thread->wakeup_flag = 0;
if(csrResult != CSR_RESULT_SUCCESS) {
if (csrResult == CSR_WIFI_HIP_RESULT_NO_DEVICE) { unifi_trace(priv, UDBG3, "bh_thread calls unifi_bh().\n");
CsrSdioRelease(priv->sdio);
uf_wait_for_thread_to_stop(priv, this_thread); CsrSdioClaim(priv->sdio);
break; csrResult = unifi_bh(priv->card, &timeout);
} if (csrResult != CSR_RESULT_SUCCESS) {
/* Errors must be delivered to the error task */ if (csrResult == CSR_WIFI_HIP_RESULT_NO_DEVICE) {
handle_bh_error(priv); CsrSdioRelease(priv->sdio);
} uf_wait_for_thread_to_stop(priv, this_thread);
CsrSdioRelease(priv->sdio); break;
} }
/* Errors must be delivered to the error task */
/* handle_bh_error(priv);
* I would normally try to call csr_sdio_remove_irq() here to make sure }
* that we do not get any interrupts while this thread is not running. CsrSdioRelease(priv->sdio);
* However, the MMC/SDIO driver tries to kill its' interrupt thread. }
* The kernel threads implementation does not allow to kill threads
* from a signalled to stop thread. /*
* So, instead call csr_sdio_linux_remove_irq() always after calling * I would normally try to call csr_sdio_remove_irq() here to make sure
* uf_stop_thread() to kill this thread. * that we do not get any interrupts while this thread is not running.
*/ * However, the MMC/SDIO driver tries to kill its' interrupt thread.
* The kernel threads implementation does not allow to kill threads
unifi_trace(priv, UDBG2, "bh_thread exiting....\n"); * from a signalled to stop thread.
return 0; * So, instead call csr_sdio_linux_remove_irq() always after calling
* uf_stop_thread() to kill this thread.
*/
unifi_trace(priv, UDBG2, "bh_thread exiting....\n");
return 0;
} /* bh_thread_function() */ } /* bh_thread_function() */
...@@ -319,33 +324,33 @@ static int bh_thread_function(void *arg) ...@@ -319,33 +324,33 @@ static int bh_thread_function(void *arg)
* 0 on success or else a Linux error code. * 0 on success or else a Linux error code.
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
*/ */
int int
uf_init_bh(unifi_priv_t *priv) uf_init_bh(unifi_priv_t *priv)
{ {
int r; int r;
/* Enable mlme interface. */ /* Enable mlme interface. */
priv->io_aborted = 0; priv->io_aborted = 0;
/* Start the BH thread */ /* Start the BH thread */
r = uf_start_thread(priv, &priv->bh_thread, bh_thread_function); r = uf_start_thread(priv, &priv->bh_thread, bh_thread_function);
if (r) { if (r) {
unifi_error(priv, unifi_error(priv,
"uf_init_bh: failed to start the BH thread.\n"); "uf_init_bh: failed to start the BH thread.\n");
return r; return r;
} }
/* Allow interrupts */ /* Allow interrupts */
r = csr_sdio_linux_install_irq(priv->sdio); r = csr_sdio_linux_install_irq(priv->sdio);
if (r) { if (r) {
unifi_error(priv, unifi_error(priv,
"uf_init_bh: failed to install the IRQ.\n"); "uf_init_bh: failed to install the IRQ.\n");
uf_stop_thread(priv, &priv->bh_thread); uf_stop_thread(priv, &priv->bh_thread);
} }
return r; return r;
} /* uf_init_bh() */ } /* uf_init_bh() */
...@@ -370,28 +375,30 @@ uf_init_bh(unifi_priv_t *priv) ...@@ -370,28 +375,30 @@ uf_init_bh(unifi_priv_t *priv)
*/ */
CsrResult unifi_run_bh(void *ospriv) CsrResult unifi_run_bh(void *ospriv)
{ {
unifi_priv_t *priv = ospriv; unifi_priv_t *priv = ospriv;
/* /*
* If an error has occurred, we discard silently all messages from the bh * If an error has occurred, we discard silently all messages from the bh
* until the error has been processed and the unifi has been reinitialised. * until the error has been processed and the unifi has been
*/ * reinitialised.
if (priv->bh_thread.block_thread == 1) { */
unifi_trace(priv, UDBG3, "unifi_run_bh: discard message.\n"); if (priv->bh_thread.block_thread == 1) {
/* unifi_trace(priv, UDBG3, "unifi_run_bh: discard message.\n");
* Do not try to acknowledge a pending interrupt here. /*
* This function is called by unifi_send_signal() which in turn can be * Do not try to acknowledge a pending interrupt here.
* running in an atomic or 'disabled irq' level if a signal is sent * This function is called by unifi_send_signal()
* from a workqueue task (i.e multicass addresses set). * which in turn can be running in an atomic or 'disabled irq'
* We can not hold the SDIO lock because it might sleep. * level if a signal is sent from a workqueue task
*/ * (i.e multicass addresses set). We can not hold the SDIO lock
return CSR_RESULT_FAILURE; * because it might sleep.
} */
return CSR_RESULT_FAILURE;
priv->bh_thread.wakeup_flag = 1; }
/* wake up I/O thread */
wake_up_interruptible(&priv->bh_thread.wakeup_q); priv->bh_thread.wakeup_flag = 1;
/* wake up I/O thread */
return CSR_RESULT_SUCCESS; wake_up_interruptible(&priv->bh_thread.wakeup_q);
return CSR_RESULT_SUCCESS;
} /* unifi_run_bh() */ } /* unifi_run_bh() */
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