aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIulia Manda <iulia.manda21@gmail.com>2014-10-22 17:17:04 +0300
committerJosh Triplett <josh@joshtriplett.org>2014-11-14 12:11:04 -0800
commitb043d487e255ddc091a6eab2abde1beae59c2a53 (patch)
tree1089ea521cb2abead7033c66249f70b3fafda204
parent4bf14462d614c401b6e97e3bbe8ca2cfed9f6f04 (diff)
downloadlinux-tiny/unflex-array.tar.gz
lib: Conditionally compile flex_arraytiny/unflex-array
This patch compiles flex_array only if CONFIG_FLEX_ARRAY is set. The logic implied by flex_array is only used in openvswitch/, selinux/ and proc/, so these should select the symbol when they are enabled. Bloat-o-meter output: add/remove: 0/11 grow/shrink: 0/0 up/down: 0/-813 (-813) function old new delta flex_array_get_ptr 15 - -15 flex_array_free 16 - -16 fa_element_to_part_nr 36 - -36 flex_array_free_parts 40 - -40 __fa_get_part 62 - -62 flex_array_get 78 - -78 flex_array_clear 91 - -91 flex_array_shrink 94 - -94 flex_array_put 104 - -104 flex_array_prealloc 111 - -111 flex_array_alloc 166 - -166 Signed-off-by: Iulia Manda <iulia.manda21@gmail.com> [josh: Updated bloat-o-meter output.] Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Josh Triplett <josh@joshtriplett.org>
-rw-r--r--fs/proc/Kconfig1
-rw-r--r--lib/Kconfig3
-rw-r--r--lib/Makefile3
-rw-r--r--net/openvswitch/Kconfig1
-rw-r--r--security/selinux/Kconfig1
5 files changed, 8 insertions, 1 deletions
diff --git a/fs/proc/Kconfig b/fs/proc/Kconfig
index 2183fcf41d5933..2d624b74eedc26 100644
--- a/fs/proc/Kconfig
+++ b/fs/proc/Kconfig
@@ -1,6 +1,7 @@
config PROC_FS
bool "/proc file system support" if EXPERT
default y
+ select FLEX_ARRAY
help
This is a virtual file system providing information about the status
of the system. "Virtual" means that it doesn't take up any space on
diff --git a/lib/Kconfig b/lib/Kconfig
index 54cf309a92a5ed..a4c7c1f3952c18 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -54,6 +54,9 @@ config ARCH_USE_CMPXCHG_LOCKREF
config ARCH_HAS_FAST_MULTIPLIER
bool
+config FLEX_ARRAY
+ bool
+
config CRC_CCITT
tristate "CRC-CCITT functions"
help
diff --git a/lib/Makefile b/lib/Makefile
index 0211d2bd5e1755..1e931360cea46c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -24,9 +24,10 @@ obj-y += lockref.o
obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
- gcd.o lcm.o list_sort.o uuid.o flex_array.o iovec.o clz_ctz.o \
+ gcd.o lcm.o list_sort.o uuid.o iovec.o clz_ctz.o \
bsearch.o find_last_bit.o find_next_bit.o llist.o memweight.o kfifo.o \
percpu-refcount.o percpu_ida.o hash.o rhashtable.o reciprocal_div.o
+obj-$(CONFIG_FLEX_ARRAY) += flex_array.o
obj-y += string_helpers.o
obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o
obj-y += kstrtox.o
diff --git a/net/openvswitch/Kconfig b/net/openvswitch/Kconfig
index ba3bb8203b999b..1d979cecd66e5f 100644
--- a/net/openvswitch/Kconfig
+++ b/net/openvswitch/Kconfig
@@ -5,6 +5,7 @@
config OPENVSWITCH
tristate "Open vSwitch"
select LIBCRC32C
+ select FLEX_ARRAY
---help---
Open vSwitch is a multilayer Ethernet switch targeted at virtualized
environments. In addition to supporting a variety of features
diff --git a/security/selinux/Kconfig b/security/selinux/Kconfig
index bca1b74a4a2f25..cfcc7c114811b7 100644
--- a/security/selinux/Kconfig
+++ b/security/selinux/Kconfig
@@ -2,6 +2,7 @@ config SECURITY_SELINUX
bool "NSA SELinux Support"
depends on SECURITY_NETWORK && AUDIT && NET && INET
select NETWORK_SECMARK
+ select FLEX_ARRAY
default n
help
This selects NSA Security-Enhanced Linux (SELinux).