strange loop!!

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

 



Hi all,
i found this bit of code somewhere in the kernel.
cud NE one explain why the do...while is required???

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

this will execute only once, so why the do....while at all???

TIA
mandeep


-----Original Message-----
From: Kiran Kumar [mailto:immidi_kiran@yahoo.com]
Sent: Monday, January 19, 2004 3:30 PM
To: kernelnewbies@nl.linux.org
Subject: skbuff query


Hi,
  Can some one clarify why this code piece
(alloc_skb() skbuff.c) has ++count < 5? Should it not
be greater than, if it intends to tolerate the
condition 5 times.

if (in_interrupt() && (gfp_mask & __GFP_WAIT)) {
      static int count = 0;
      if (++count < 5) {
      printk(KERN_ERR "alloc_skb called nonatomically
"
              "from interrupt %p\n",
NET_CALLER(size));
                BUG();
      }
                gfp_mask &= ~__GFP_WAIT;
}

=====
Regards,
Kiran Kumar Immidi

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

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


--
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