how does do{} while(0) work in macro?
问题 Though this topic has been discussed many times in this forum and all other forums, still I have doubts. Please help. How does the do{} while(0) in macro work in Linux kernel? For example, #define preempt_disable() do { } while (0) How does it disable preempt? #define might_resched() do { } while (0) How does it reschedule? Similarly I have seen macros for mutex locks and other also. How does this help? I understand for following problem but not for the examples above. #define foo(x) do { do