staging/csr: clean coding style in uf_start_thread
in bh.c the function uf_start_thread needed a coding style fixes. The following fixes: * fix no space at the start of line * fix over 80 character lines * fix no brace needed for single statement blocks (if..else or for and while) * use tabs instead of 4 spaces at the start of every line Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com> Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com> Cc: Riku Mettälä <riku.mettala@bluegiga.com> Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com> Signed-off-by: Devendra Naga <develkernel412222@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
08fb73c1c8
commit
cff9e59f65
|
@ -32,45 +32,49 @@
|
||||||
* 0 on success or else a Linux error code.
|
* 0 on success or else a Linux error code.
|
||||||
* ---------------------------------------------------------------------------
|
* ---------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int uf_start_thread(unifi_priv_t *priv,
|
||||||
uf_start_thread(unifi_priv_t *priv, struct uf_thread *thread, int (*func)(void *))
|
struct uf_thread *thread, int (*func)(void *))
|
||||||
{
|
{
|
||||||
if (thread->thread_task != NULL) {
|
if (thread->thread_task != NULL) {
|
||||||
unifi_error(priv, "%s thread already started\n", thread->name);
|
unifi_error(priv, "%s thread already started\n", thread->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start the kernel thread that handles all h/w accesses. */
|
/* Start the kernel thread that handles all h/w accesses. */
|
||||||
thread->thread_task = kthread_run(func, priv, "%s", thread->name);
|
thread->thread_task = kthread_run(func, priv, "%s", thread->name);
|
||||||
if (IS_ERR(thread->thread_task)) {
|
if (IS_ERR(thread->thread_task))
|
||||||
return PTR_ERR(thread->thread_task);
|
return PTR_ERR(thread->thread_task);
|
||||||
}
|
|
||||||
|
|
||||||
/* Module parameter overides the thread priority */
|
/* Module parameter overides the thread priority */
|
||||||
if (bh_priority != -1) {
|
if (bh_priority != -1) {
|
||||||
if (bh_priority >= 0 && bh_priority <= MAX_RT_PRIO) {
|
if (bh_priority >= 0 && bh_priority <= MAX_RT_PRIO) {
|
||||||
struct sched_param param;
|
struct sched_param param;
|
||||||
priv->bh_thread.prio = bh_priority;
|
priv->bh_thread.prio = bh_priority;
|
||||||
unifi_trace(priv, UDBG1, "%s thread (RT) priority = %d\n",
|
unifi_trace(priv, UDBG1,
|
||||||
thread->name, bh_priority);
|
"%s thread (RT) priority = %d\n",
|
||||||
param.sched_priority = bh_priority;
|
thread->name, bh_priority);
|
||||||
sched_setscheduler(thread->thread_task, SCHED_FIFO, ¶m);
|
param.sched_priority = bh_priority;
|
||||||
} else if (bh_priority > MAX_RT_PRIO && bh_priority <= MAX_PRIO) {
|
sched_setscheduler(thread->thread_task,
|
||||||
priv->bh_thread.prio = bh_priority;
|
SCHED_FIFO, ¶m);
|
||||||
unifi_trace(priv, UDBG1, "%s thread priority = %d\n",
|
} else if (bh_priority > MAX_RT_PRIO &&
|
||||||
thread->name, PRIO_TO_NICE(bh_priority));
|
bh_priority <= MAX_PRIO) {
|
||||||
set_user_nice(thread->thread_task, PRIO_TO_NICE(bh_priority));
|
priv->bh_thread.prio = bh_priority;
|
||||||
} else {
|
unifi_trace(priv, UDBG1, "%s thread priority = %d\n",
|
||||||
priv->bh_thread.prio = DEFAULT_PRIO;
|
thread->name,
|
||||||
unifi_warning(priv, "%s thread unsupported (%d) priority\n",
|
PRIO_TO_NICE(bh_priority));
|
||||||
thread->name, bh_priority);
|
set_user_nice(thread->thread_task,
|
||||||
}
|
PRIO_TO_NICE(bh_priority));
|
||||||
} else {
|
} else {
|
||||||
priv->bh_thread.prio = DEFAULT_PRIO;
|
priv->bh_thread.prio = DEFAULT_PRIO;
|
||||||
}
|
unifi_warning(priv,
|
||||||
unifi_trace(priv, UDBG2, "Started %s thread\n", thread->name);
|
"%s thread unsupported (%d) priority\n",
|
||||||
|
thread->name, bh_priority);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
priv->bh_thread.prio = DEFAULT_PRIO;
|
||||||
|
unifi_trace(priv, UDBG2, "Started %s thread\n", thread->name);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
} /* uf_start_thread() */
|
} /* uf_start_thread() */
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,8 +92,7 @@ uf_start_thread(unifi_priv_t *priv, struct uf_thread *thread, int (*func)(void *
|
||||||
*
|
*
|
||||||
* ---------------------------------------------------------------------------
|
* ---------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void
|
void uf_stop_thread(unifi_priv_t *priv, struct uf_thread *thread)
|
||||||
uf_stop_thread(unifi_priv_t *priv, struct uf_thread *thread)
|
|
||||||
{
|
{
|
||||||
if (!thread->thread_task) {
|
if (!thread->thread_task) {
|
||||||
unifi_notice(priv, "%s thread is already stopped\n", thread->name);
|
unifi_notice(priv, "%s thread is already stopped\n", thread->name);
|
||||||
|
|
Loading…
Reference in a new issue