Re: [PATCH][1/2] SquashFS

Junio C Hamano
2005-03-16T01:50:10Z

>>>>> "PJ" == Paul Jackson <pj@engr.sgi.com> writes:

PJ> There is not a concensus (nor a King Penguin dictate) between the
PJ> "while(1)" and "for(;;)" style to document.

FWIW, linux-0.01 has four uses of "while (1)" and two uses of
"for (;;)" ;-).

./fs/inode.c: while (1) {
./fs/namei.c: while (1) {
./fs/namei.c: while (1) {
./kernel/sched.c: while (1) {

./init/main.c: for(;;) pause();
./kernel/panic.c: for(;;);

What is interesting here is that the King Penguin used these two
constructs with consistency. The "while (1)" form was used with
normal exit routes with "if (...) break" inside; while the
"for(;;)" form was used only in unusual "the thread of control
should get stuck here forever" cases.

So, Phillip's decision to go back to his original while(1) style
seems to be in line with the style used in the original Linux
kernel ;-).