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
     

08 Apr, 2020

1 commit

  • The current codebase makes use of the zero-length array language extension
    to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning in
    case the flexible array does not occur last in the structure, which will
    help us prevent some kind of undefined behavior bugs from being
    inadvertenly introduced[3] to the codebase from now on.

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Andrew Morton
    Link: http://lkml.kernel.org/r/20200211205813.GA25602@embeddedor
    Signed-off-by: Linus Torvalds

    Gustavo A. R. Silva
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

22 Oct, 2017

1 commit


08 Jul, 2008

1 commit


30 Sep, 2006

1 commit


01 Jul, 2006

1 commit


09 Oct, 2005

1 commit

  • - added typedef unsigned int __nocast gfp_t;

    - replaced __nocast uses for gfp flags with gfp_t - it gives exactly
    the same warnings as far as sparse is concerned, doesn't change
    generated code (from gcc point of view we replaced unsigned int with
    typedef) and documents what's going on far better.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

05 Oct, 2005

1 commit


24 Jun, 2005

1 commit

  • A finite state machine consists of n states (struct ts_fsm_token)
    representing the pattern as a finite automation. The data is read
    sequentially on a octet basis. Every state token specifies the number
    of recurrences and the type of value accepted which can be either a
    specific character or ctype based set of characters. The available
    type of recurrences include 1, (0|1), [0 n], and [1 n].

    The algorithm differs between strict/non-strict mode specyfing
    whether the pattern has to start at the first octect. Strict mode
    is enabled by default and can be disabled by inserting
    TS_FSM_HEAD_IGNORE as the first token in the chain.

    The runtime performance of the algorithm should be around O(n),
    however while in strict mode the average runtime can be better.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf