bfs: bfad_worker cleanup

This kthread is not loop at all due to break at the end of the loop.  Make
that function linear, with no while loop.

And remove an unnecessary cast.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Jiri Slaby 2015-04-16 12:48:29 -07:00 committed by Linus Torvalds
parent c8f33d0bec
commit 8f7d3f0f1e
1 changed files with 9 additions and 13 deletions

View File

@ -1079,22 +1079,18 @@ bfad_start_ops(struct bfad_s *bfad) {
int
bfad_worker(void *ptr)
{
struct bfad_s *bfad;
unsigned long flags;
struct bfad_s *bfad = ptr;
unsigned long flags;
bfad = (struct bfad_s *)ptr;
if (kthread_should_stop())
return 0;
while (!kthread_should_stop()) {
/* Send event BFAD_E_INIT_SUCCESS */
bfa_sm_send_event(bfad, BFAD_E_INIT_SUCCESS);
/* Send event BFAD_E_INIT_SUCCESS */
bfa_sm_send_event(bfad, BFAD_E_INIT_SUCCESS);
spin_lock_irqsave(&bfad->bfad_lock, flags);
bfad->bfad_tsk = NULL;
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
break;
}
spin_lock_irqsave(&bfad->bfad_lock, flags);
bfad->bfad_tsk = NULL;
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
return 0;
}