16 Oct, 2018

1 commit

  • kbuild robot reports that since commit ce76d938dd98 ("lib: Add memcat_p():
    paste 2 pointer arrays together") the ia64/hp/sim/boot fails to link:

    > LD arch/ia64/hp/sim/boot/bootloader
    > lib/string.o: In function `__memcat_p':
    > string.c:(.text+0x1f22): undefined reference to `__kmalloc'
    > string.c:(.text+0x1ff2): undefined reference to `__kmalloc'
    > make[1]: *** [arch/ia64/hp/sim/boot/Makefile:37: arch/ia64/hp/sim/boot/bootloader] Error 1

    The reason is, the above commit, via __memcat_p(), adds a call to
    __kmalloc to string.o, which happens to be used in the bootloader, but
    there's no kmalloc or slab or anything.

    Since the linker would only pull in objects that contain referenced
    symbols, moving __memcat_p() to a different compilation unit solves the
    problem.

    Fixes: ce76d938dd98 ("lib: Add memcat_p(): paste 2 pointer arrays together")
    Signed-off-by: Alexander Shishkin
    Reported-by: kbuild test robot
    Cc: Fenghua Yu
    Cc: Tony Luck
    Cc: Joe Perches
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin
     

11 Oct, 2018

1 commit

  • This adds a helper to paste 2 pointer arrays together, useful for merging
    various types of attribute arrays. There are a few places in the kernel
    tree where this is open coded, and I just added one more in the STM class.

    The naming is inspired by memset_p() and memcat(), and partial credit for
    it goes to Andy Shevchenko.

    This patch adds the function wrapped in a type-enforcing macro and a test
    module.

    Signed-off-by: Alexander Shishkin
    Reviewed-by: Andy Shevchenko
    Tested-by: Mathieu Poirier
    Signed-off-by: Greg Kroah-Hartman

    Alexander Shishkin