]> 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>
Fri, 9 Sep 2011 06:16:16 +0000 (16:16 +1000)
commit26eeaa0aacd093a03d4d937b7ccd41bfd352d3d3
tree6e81486e613a3710d04fa3835d72c2117e955f72
parenta0656fb06d2de39723b17e3965d3a73d1c57f12f
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