Doubt in linux/list.h

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

 



Hi,
   In linux/list.h, there is the following lines. Why use a do-while
loop when the statements inside is run only once.

#define INIT_LIST_HEAD(ptr) do { \
       (ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)


Libin Varghese
--


*******************************************************************
Experts arose from their own urgent need to exist. - Murphy's laws

When the software itches you, scratch the Code. - Libin Varghese :D
*******************************************************************




--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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