I don't know about this specific loop you are talking about, but this kind of loops is usualy used to create a block. Inside this block you can define variables whose scope is this block. H. On Mon, 19 Jan 2004, Mandeep Singh Sandhu wrote: > 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/ > -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/