Skip to content

Commit

Permalink
bfs: bfad_worker cleanup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Apr 17, 2015
1 parent c8f33d0 commit 8f7d3f0
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions drivers/scsi/bfa/bfad.c
Original file line number Diff line number Diff line change
Expand Up @@ -1079,22 +1079,18 @@ bfad_start_ops(struct bfad_s *bfad) {
int
bfad_worker(void *ptr)
{
struct bfad_s *bfad;
unsigned long flags;

bfad = (struct bfad_s *)ptr;

while (!kthread_should_stop()) {
struct bfad_s *bfad = ptr;
unsigned long flags;

/* Send event BFAD_E_INIT_SUCCESS */
bfa_sm_send_event(bfad, BFAD_E_INIT_SUCCESS);
if (kthread_should_stop())
return 0;

spin_lock_irqsave(&bfad->bfad_lock, flags);
bfad->bfad_tsk = NULL;
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
/* Send event BFAD_E_INIT_SUCCESS */
bfa_sm_send_event(bfad, BFAD_E_INIT_SUCCESS);

break;
}
spin_lock_irqsave(&bfad->bfad_lock, flags);
bfad->bfad_tsk = NULL;
spin_unlock_irqrestore(&bfad->bfad_lock, flags);

return 0;
}
Expand Down

0 comments on commit 8f7d3f0

Please sign in to comment.