]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
vmstat_text is only available when PROC_FS or SYSFS is enabled. This
authorRandy Dunlap <rdunlap@xenotime.net>
Wed, 24 Aug 2011 23:47:20 +0000 (09:47 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 15 Sep 2011 06:21:29 +0000 (16:21 +1000)
commit83de0d61ccaf7b40057653451b1ba8094c9fd348
tree9c883cd71227d0ecba7a621135c43b22e4f6e637
parenta1ec298580910a629d1d6530e82787b27f2a13ce
vmstat_text is only available when PROC_FS or SYSFS is enabled.  This
causes build errors in drivers/base/node.c when they are both disabled:

drivers/built-in.o: In function `node_read_vmstat':
node.c:(.text+0x10e28f): undefined reference to `vmstat_text'

Rather than litter drivers/base/node.c with #ifdef/#endif around the
affected lines of code, add macros for optional sysdev attributes so that
those lines of code will be ignored, without using #ifdef/#endif in the .c
file(s).  I.e., the ifdeffery is done only in a header file with
sysdev_create_file_optional() and sysdev_remove_file_optional().

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Amerigo Wang <amwang@redhat.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/base/node.c
include/linux/sysdev.h
include/linux/vmstat.h