linux/include
David Howells 09570f9149 proc: make struct proc_dir_entry::name a terminal array rather than a pointer
Since __proc_create() appends the name it is given to the end of the PDE
structure that it allocates, there isn't a need to store a name pointer.
Instead we can just replace the name pointer with a terminal char array of
_unspecified_ length.  The compiler will simply append the string to statically
defined variables of PDE type overlapping any hole at the end of the structure
and, unlike specifying an explicitly _zero_ length array, won't give a warning
if you try to statically initialise it with a string of more than zero length.

Also, whilst we're at it:

 (1) Move namelen to end just prior to name and reduce it to a single byte
     (name shouldn't be longer than NAME_MAX).

 (2) Move pde_unload_lock two places further on so that if it's four bytes in
     size on a 64-bit machine, it won't cause an unused hole in the PDE struct.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-27 12:50:45 -07:00
..
acpi atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
asm-generic Merge branch 'next/cross-platform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc 2011-07-26 17:12:10 -07:00
crypto
drm atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
keys
linux proc: make struct proc_dir_entry::name a terminal array rather than a pointer 2011-07-27 12:50:45 -07:00
math-emu
media
mtd
net atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
pcmcia atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
rdma atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
rxrpc atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
scsi atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
sound Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 2011-07-27 09:25:15 -07:00
target
trace Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6 2011-07-26 11:34:40 -07:00
video
xen
Kbuild