Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jiri Slaby and committed by
Linus Torvalds
8f7d3f0f c8f33d0b

+9 -13
+9 -13
drivers/scsi/bfa/bfad.c
··· 1079 1079 int 1080 1080 bfad_worker(void *ptr) 1081 1081 { 1082 - struct bfad_s *bfad; 1083 - unsigned long flags; 1082 + struct bfad_s *bfad = ptr; 1083 + unsigned long flags; 1084 1084 1085 - bfad = (struct bfad_s *)ptr; 1085 + if (kthread_should_stop()) 1086 + return 0; 1086 1087 1087 - while (!kthread_should_stop()) { 1088 + /* Send event BFAD_E_INIT_SUCCESS */ 1089 + bfa_sm_send_event(bfad, BFAD_E_INIT_SUCCESS); 1088 1090 1089 - /* Send event BFAD_E_INIT_SUCCESS */ 1090 - bfa_sm_send_event(bfad, BFAD_E_INIT_SUCCESS); 1091 - 1092 - spin_lock_irqsave(&bfad->bfad_lock, flags); 1093 - bfad->bfad_tsk = NULL; 1094 - spin_unlock_irqrestore(&bfad->bfad_lock, flags); 1095 - 1096 - break; 1097 - } 1091 + spin_lock_irqsave(&bfad->bfad_lock, flags); 1092 + bfad->bfad_tsk = NULL; 1093 + spin_unlock_irqrestore(&bfad->bfad_lock, flags); 1098 1094 1099 1095 return 0; 1100 1096 }