]> git.karo-electronics.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>
Tue, 27 Sep 2011 07:13:57 +0000 (17:13 +1000)
commit3b094d9f1d28ed04b78ca68a065bf1dc75ad147c
treecb2b70cf6bcd8c56c116b5b80691c5bc912f129d
parent2e590c33a708e5e5c77921f94fc8793e4658da72
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