do ... while(0) loop constructs in kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi,

Can someone tell me why we use constructs like as follows:

do{
....
....
....
}while(0);

what the use of this, why we put the instructions in do while loop when the loop have condition zero. I have seen such constructs at number of places in kernel code.
also read on some site the benefit of such constructs, but my memory is not that good to recover it.

regards,
-Gaurav


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux