Skip to contentSkip to conversation

drivers/char/selection.c: replace direct assignment

PATCH In review Christophe Lucas 2 participants 2 messages May 4, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/char/selection.c: replace direct assignment

description:
Use set_current_state() instead of direct assignment of current->state.

drivers/char/selection.c +1 -1
diff -urpNX dontdiff a/drivers/char/selection.c b/drivers/char/selection.c
@@ -299,7 +299,7 @@ int paste_selection(struct tty_struct *t
 		pasted += count;
 	}
 	remove_wait_queue(&vc->paste_wait, &wait);
-	current->state = TASK_RUNNING;
+	set_current_state(TASK_RUNNING);
 
 	tty_ldisc_deref(ld);
 	return 0;

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw
Quoted 3 lines · Christophe Lucas

description:
Use set_current_state() instead of direct assignment of current->state.

Usually, when you are setting the state to TASK_RUNNING, you don't want to use set_current_state(), but __set_current_state(). The best bet is to see if you can't convert the wait-queue usage in that function to prepare_to_wait()/finish_wait().

Good luck,
Nish

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors