25 Aug, 2020

1 commit

  • The following build error for powerpc64 was reported by Nathan Chancellor:

    "$ scripts/config --file arch/powerpc/configs/powernv_defconfig -e KERNEL_XZ

    $ make -skj"$(nproc)" ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- distclean powernv_defconfig zImage
    ...
    In file included from arch/powerpc/boot/../../../lib/decompress_unxz.c:234,
    from arch/powerpc/boot/decompress.c:38:
    arch/powerpc/boot/../../../lib/xz/xz_dec_stream.c: In function 'dec_main':
    arch/powerpc/boot/../../../lib/xz/xz_dec_stream.c:586:4: error: 'fallthrough' undeclared (first use in this function)
    586 | fallthrough;
    | ^~~~~~~~~~~

    This will end up affecting distribution configurations such as Debian
    and OpenSUSE according to my testing. I am not sure what the solution
    is, the PowerPC wrapper does not set -D__KERNEL__ so I am not sure
    that compiler_attributes.h can be safely included."

    In order to avoid these sort of problems, it seems that the best
    solution is to use /* fall through */ comments instead of the
    fallthrough pseudo-keyword macro in lib/, for now.

    Reported-by: Nathan Chancellor
    Fixes: df561f6688fe ("treewide: Use fallthrough pseudo-keyword")
    Signed-off-by: Gustavo A. R. Silva
    Reviewed-and-tested-by: Nathan Chancellor
    Signed-off-by: Linus Torvalds

    Gustavo A. R. Silva
     

24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

25 Feb, 2017

1 commit

  • Extract the glob test code into its own source file, to allow to compile
    it either to a loadable module, or builtin into the kernel.

    Link: http://lkml.kernel.org/r/1483470276-10517-2-git-send-email-geert@linux-m68k.org
    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     

07 Aug, 2014

2 commits

  • This was useful during development, and is retained for future
    regression testing.

    GCC appears to have no way to place string literals in a particular
    section; adding __initconst to a char pointer leaves the string itself
    in the default string section, where it will not be thrown away after
    module load.

    Thus all string constants are kept in explicitly declared and named
    arrays. Sorry this makes printk a bit harder to read. At least the
    tests are more compact.

    Signed-off-by: George Spelvin
    Cc: Randy Dunlap
    Cc: Tejun Heo
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    George Spelvin
     
  • This is a helper function from drivers/ata/libata_core.c, where it is
    used to blacklist particular device models. It's being moved to lib/ so
    other drivers may use it for the same purpose.

    This implementation in non-recursive, so is safe for the kernel stack.

    [akpm@linux-foundation.org: fix sparse warning]
    Signed-off-by: George Spelvin
    Cc: Randy Dunlap
    Cc: Tejun Heo
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    George Spelvin