[lkml]   [2002]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Combined APM patch
> Just browsing the diff between my patch and Stephen's, I have
> a couple of questions.

> < static int suspends_pending; /* = 0 */
> ---
> > static int suspends_pending;

> Is it not good practice to note when the code _assumes_ zero-
> initialization? I have seen comments like these elsewhere in
> the kernel sources.

Comments should _not_ echo code. One should assumes that the reader
knows the language. Instead, comments should explain _what the purpose_
of that line of code or section of code is if it is not obvious to those
that the comments are written to.

Thus, the following should be considered correct:

static int suspends_pending;

Both of the following lines have superfluous code or commants and should
be avoided:

static int suspends_pending; /* = 0 */
static int suspends_pending = 0;

Likewise, parentheses where none are needed just get in the way of useful
stuff and slows down understanding the program. Some parentheses in
complex expressions or when the precedence of operator evaluation is
confusing, such as bitwise ops can be helpful.

Btw, I have been writing system-level c code for 26 years and learned by
reading and modifying Unix system code at Berkeley.

Best regards,

Bob Toxen, CTO
Fly-By-Day Consulting, Inc. "Experts in Linux & network security" [Linux/Unix & Network Security Consulting] [My 5* book: "Real World Linux Security"] [Sunset Computer]
Quality Linux, UNIX and network security and software consulting since 1990.

GPG Public key available at (
and at
and on the CD-ROM that comes sealed and attached to Real World Linux Security
pub 1024D/E3A1C540 2000-06-21 Bob Toxen <>
Key fingerprint = 30BA AA0A 31DD B68B 47C9 601E 96D3 533D E3A1 C540
sub 2048g/03FFCCB9 2000-06-21
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:15    [W:0.053 / U:3.596 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site