]> 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, 22 Sep 2011 08:26:26 +0000 (18:26 +1000)
commitf49e6127721c97da703bca0593b43a1a0b1975d7
treec573fbb1bfa9003f93b15c191c4d2419a850a3bd
parentef2f5b5a15847ee9247a9346a660aada0b289c65
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