[lkml]   [2000]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] removal of "static foo = 0"

On Sun, 26 Nov 2000, Alexander Viro wrote:

> I would suggest you to read through the following book and files:
> * Kernighan & Pike, "The Practice of Programming"
> * Documentation/CodingStyle
> * drivers/net/aironet4500_proc.c
> and consider, erm, discrepancies. On the second thought, reading K&R
> might also be useful. IOW, no offense, but your C is bad beyond belief.

Yep, very true.
aironet4500_proc.c is ugly. And is because there is quickly handwirtten
something that should have been generic for kernel for some long time, not
for every driver-writer to reinvent a wheel.
Note that there is something that virtually elliminates need for
exact user<->kernel level interfaces and userlevel kerneldata manipulation
programs and lots of other maintenance pains.
And it does it in quite short sentences. Plus, half of that file is direct
repeating of some non-exported kernel functions. But, if you think you can
do better, then look into aironet4500_rid.c and handcode it (like real K&R
people do), instead of using aironet4500_proc.c to operate on it.
Also, pcmcia/aironet4500_cs.c has lots of ugly parts. Those which are
related to stupid masohistic code repetitions due to pcmcia package
interface being "cutting edge optimal stupid"

The same true is that 2.4 kernel is, in commercial production sense, late
for 6 months. And reason being that the codebase and testing becomes
unmanageable. And it becomes unmanageable, because some people only read
K&R and try to optimize last bit out of it with using and old book.

I'd really propose again:
1. universal debug macros
2. universalt user-kernelspace configuration interface via proc/sys

I'd really like C++, but it can be done with C and macros.
Some years ago I even managed to write something like stl container
withing C and with macros. That was really screwy thing.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:47    [W:0.116 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site