do ... while(0) loop constructs in kernel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: kernelnewbies <kernelnewbies@xxxxxxxxxxxx>
- Subject: do ... while(0) loop constructs in kernel
- From: Gaurav Dhiman <gaurav4lkg@xxxxxxxxx>
- Date: Tue, 30 Aug 2005 15:09:19 +0530
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=amBsTQAML8ffhJnKYQtmaUJpTeEP0OJknC/9Qi4qEvmrXrUAUiYf3MA1wtfeX4ppY585tJ/kwMfhI502zl9q1WyWPDZ1/smsVECiD9hcEK9RUhO4ALp0TH5PaapMmrXftUx9DOdkG4HSVfVHRZnVTfpYsIIVBSEfJchqMLaxkTs=
- Sender: kernelnewbies-bounce@xxxxxxxxxxxx
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]