• Rasmus Villemoes's avatar
    lib/list_sort.c: rearrange includes · 7259fa04
    Rasmus Villemoes authored
    Memory allocation only happens in the self test, just as random numbers
    are only used there.  So move the inclusion of slab.h inside the
    CONFIG_TEST_LIST_SORT.
    
    We don't need module.h and all of the stuff it carries with it, so replace
    with export.h and compiler.h.  Unfortunately, the ARRAY_SIZE macro from
    kernel.h requires the user to ensure bug.h is also included (for
    BUILD_BUG_ON_ZERO, used by __must_be_array).  We used to get that through
    some maze of nested includes, but just include it explicitly.
    
    linux/string.h is then only included implicitly through
    kernel.h->printk.h->dynamic_debug.h, but only if !CONFIG_DYNAMIC_DEBUG, so
    just include it explicitly (for memset).
    
    objdump -d says the generated code is the same, and wc -l says that
    lib/.list_sort.o.cmd went from 579 to 165 lines.
    Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    7259fa04
list_sort.c 6.82 KB