aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2015-04-16 15:48:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-17 09:04:09 -0400
commit8f7d3f0f1ed5dce6ea7b833ec19cabe61a6e7ff8 (patch)
tree13c3c078fa99b279ffe72a09b1a326c95a97cf25
parentc8f33d0bec999a4f2b5c3f9380361b88ce6f6ab0 (diff)
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>
-rw-r--r--drivers/scsi/bfa/bfad.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index e90a3742f09d..cc3b9d3d6d40 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1079,22 +1079,18 @@ bfad_start_ops(struct bfad_s *bfad) {
1079int 1079int
1080bfad_worker(void *ptr) 1080bfad_worker(void *ptr)
1081{ 1081{
1082 struct bfad_s *bfad; 1082 struct bfad_s *bfad = ptr;
1083 unsigned long flags; 1083 unsigned long flags;
1084
1085 bfad = (struct bfad_s *)ptr;
1086
1087 while (!kthread_should_stop()) {
1088 1084
1089 /* Send event BFAD_E_INIT_SUCCESS */ 1085 if (kthread_should_stop())
1090 bfa_sm_send_event(bfad, BFAD_E_INIT_SUCCESS); 1086 return 0;
1091 1087
1092 spin_lock_irqsave(&bfad->bfad_lock, flags); 1088 /* Send event BFAD_E_INIT_SUCCESS */
1093 bfad->bfad_tsk = NULL; 1089 bfa_sm_send_event(bfad, BFAD_E_INIT_SUCCESS);
1094 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
1095 1090
1096 break; 1091 spin_lock_irqsave(&bfad->bfad_lock, flags);
1097 } 1092 bfad->bfad_tsk = NULL;
1093 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
1098 1094
1099 return 0; 1095 return 0;
1100} 1096}