I read this in include/linux/sched.h
:
#define __set_task_state(tsk, state_value) \
do { (tsk)->state = (state_value); } while (0)
I know that when it comes to multi-statement in a body, a do {...} while (0)
should be used. But that is just one statement in the body, is it really necessary to use do {...} while (0)
? How about just as follows:
#define __set_task_state(tsk, state_value) \
((tsk)->state = (state_value))