Skip to contentSkip to conversation

2.5.27 sysctl

PATCH Ray Lee 1 participant 1 message Jul 22, 2002

lore
Share & tools
lore

Ray Lee

author
#0 lore raw

Hello there,

Quoted 9 lines

This is making the sysctl code acutally be written in C.
It wasn't mostly due to georgeous ommitted size array "forward declarations". As a side effect it makes the table structure easier to deduce.

diff -urN linux-2.5.27/include/linux/sysctl.h linux/include/linux/sysctl.h

include/linux/sysctl.h 2002-07-21 19:30:43.000000000 +0200 line 130

Quoted 6 lines
include/linux/sysctl.h 2002-07-21 19:30:43.000000000 +0200 renamed from include/linux/sysctl.h 2002-07-20 21:11:05.000000000 +0200 +1 -1
@@ -126,7 +126,7 @@
         KERN_S390_USER_DEBUG_LOGGING=51, /* int: dumps of user faults */
         KERN_CORE_USES_PID=52, /* int: use core or core.%pid */
         KERN_TAINTED=53, /* int: various kernel tainted flags */
- KERN_CADPID=54, /* int: PID of the process to notify on CAD */
+ KERN_CADPID=54 /* int: PID of the process to notify on CAD */
 };

<snip>

The comma changes are gratuitous, as pure ANSI C explicitly allows such constructs. (It was intended to simplify automatic code generation, as well as for programmer ease to automatically deal with initializer lists.)

Quoted 1 line

From the grammar section of the 2nd edition (ca. 1988) of K&R:

	initializer:
		assignment-expression
		{ initializer-list }
		{ initializer-list , }

...where initializer list is what one would expect.

Removing the size forward declarations does make the code quicker to read, though.

Ray