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

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

 



is this what u looking for..
 
http://kernelnewbies.org/faq/index.php3#dowhile
 


From: kernelnewbies-bounce@xxxxxxxxxxxx [mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of Gaurav Dhiman
Sent: Tuesday, August 30, 2005 3:09 PM
To: kernelnewbies
Subject: do ... while(0) loop constructs in kernel


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