30 Dec, 2020

1 commit

  • [ Upstream commit 03f4935135b9efeb780b970ba023c201f81cf4e6 ]

    There is an unescaped left brace in a regex in OPEN_BRACE check. This
    throws a runtime error when checkpatch is run with --fix flag and the
    OPEN_BRACE check is executed.

    Fix it by escaping the left brace.

    Link: https://lkml.kernel.org/r/20201115202928.81955-1-dwaipayanray1@gmail.com
    Fixes: 8d1824780f2f ("checkpatch: add --fix option for a couple OPEN_BRACE misuses")
    Signed-off-by: Dwaipayan Ray
    Acked-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Sasha Levin

    Dwaipayan Ray
     

26 Oct, 2020

1 commit

  • If set, use the environment variable GIT_DIR to change the default .git
    location of the kernel git tree.

    If GIT_DIR is unset, keep using the current ".git" default.

    Link: https://lkml.kernel.org/r/c5e23b45562373d632fccb8bc04e563abba4dd1d.camel@perches.com
    Signed-off-by: Joe Perches
    Tested-by: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     

17 Oct, 2020

11 commits

  • The author signed-off-by checks are currently very vague. Cases like same
    name or same address are not handled separately.

    For example, running checkpatch on commit be6577af0cef ("parisc: Add
    atomic64_set_release() define to avoid CPU soft lockups"), gives:

    WARNING: Missing Signed-off-by: line by nominal patch author
    'John David Anglin '

    The signoff line was:
    "Signed-off-by: Dave Anglin "

    Clearly the author has signed off but with a slightly different version
    of his name. A more appropriate warning would have been to point out
    at the name mismatch instead.

    Previously, the values assumed by $authorsignoff were either 0 or 1
    to indicate whether a proper sign off by author is present.
    Extended the checks to handle four new cases.

    $authorsignoff values now denote the following:

    0: Missing sign off by patch author.

    1: Sign off present and identical.

    2: Addresses and names match, but comments differ.
    "James Watson(JW) ", "James Watson "

    3: Addresses match, but names are different.
    "James Watson ", "James "

    4: Names match, but addresses are different.
    "James Watson ", "James Watson "

    5: Names match, addresses excluding subaddress details (RFC 5233) match.
    "James Watson ", "James Watson "

    Also introduced a new message type FROM_SIGN_OFF_MISMATCH
    for cases 2, 3, 4 and 5.

    Suggested-by: Joe Perches
    Signed-off-by: Dwaipayan Ray
    Signed-off-by: Andrew Morton
    Acked-by: Joe Perches
    Link: https://lore.kernel.org/linux-kernel-mentees/c1ca28e77e8e3bfa7aadf3efa8ed70f97a9d369c.camel@perches.com/
    Link: https://lkml.kernel.org/r/20201007192029.551744-1-dwaipayanray1@gmail.com
    Signed-off-by: Linus Torvalds

    Dwaipayan Ray
     
  • To avoid false positives in presence of SPDX-License-Identifier in
    networking files it is required to increase the leeway for empty block
    comment lines by one line.

    For example, checking drivers/net/loopback.c which starts with

    // SPDX-License-Identifier: GPL-2.0-or-later
    /*
    * INET An implementation of the TCP/IP protocol suite for the LINUX

    rsults in an unnecessary warning

    WARNING: networking block comments don't use an empty /* line, use /* Comment...
    +/*
    + * INET An implementation of the TCP/IP protocol suite for the LINUX

    Signed-off-by: Łukasz Stelmach
    Signed-off-by: Andrew Morton
    Acked-by: Joe Perches
    Cc: Bartłomiej Żolnierkiewicz
    Cc: Marek Szyprowski
    Link: https://lkml.kernel.org/r/20201006083509.19934-1-l.stelmach@samsung.com
    Signed-off-by: Linus Torvalds

    Łukasz Stelmach
     
  • Checkpatch.pl doesn't have a check for excluding while (...) {...} blocks
    from MULTISTATEMENT_MACRO_USE_DO_WHILE error.

    For example, running checkpatch.pl on the file mm/maccess.c in the kernel
    generates the following error:

    ERROR: Macros with complex values should be enclosed in parentheses
    +#define copy_from_kernel_nofault_loop(dst, src, len, type, err_label) \
    + while (len >= sizeof(type)) { \
    + __get_kernel_nofault(dst, src, type, err_label); \
    + dst += sizeof(type); \
    + src += sizeof(type); \
    + len -= sizeof(type); \
    + }

    The error is misleading for this case. Enclosing it in parentheses
    doesn't make any sense.

    Checkpatch already has an exception list for such common macro types.
    Added a new exception for while (...) {...} style blocks to the same.

    In addition, the brace flatten logic was modified by changing the
    substitution characters from "1" to "1u". This was done to ensure that
    macros in the form "#define foo(bar) while(bar){bar--;}" were also
    correctly procecssed.

    Link: https://lore.kernel.org/linux-kernel-mentees/dc985938aa3986702815a0bd68dfca8a03c85447.camel@perches.com/

    Suggested-by: Joe Perches
    Signed-off-by: Dwaipayan Ray
    Signed-off-by: Andrew Morton
    Link: https://lkml.kernel.org/r/20201001171903.312021-1-dwaipayanray1@gmail.com
    Signed-off-by: Linus Torvalds

    Dwaipayan Ray
     
  • Embedding the complete filename path inside the file isn't particularly
    useful as often the path is moved around and becomes incorrect.

    Emit a warning when the source contains the filename.

    [akpm@linux-foundation.org: remove stray " di"]

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Link: https://lkml.kernel.org/r/1fd5f9188a14acdca703ca00301ee323de672a8d.camel@perches.com
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Checkpatch did not handle cases where the author From: header was split
    into multiple lines. The author identity could not be resolved and
    checkpatch generated a false NO_AUTHOR_SIGN_OFF warning.

    A typical example is commit e33bcbab16d1 ("tee: add support for session's
    client UUID generation"). When checkpatch was run on this commit, it
    displayed:

    "WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal
    patch author ''"

    This was due to split header lines not being handled properly and the
    author himself wrote in commit cd2614967d8b ("checkpatch: warn if missing
    author Signed-off-by"):

    "Split From: headers are not fully handled: only the first part
    is compared."

    Support split From: headers by correctly parsing the header extension
    lines. RFC 5322, Section-2.2.3 stated that each extended line must start
    with a WSP character (a space or htab). The solution was therefore to
    concatenate the lines which start with a WSP to get the correct long
    header.

    Suggested-by: Joe Perches
    Signed-off-by: Dwaipayan Ray
    Signed-off-by: Andrew Morton
    Tested-by: Lukas Bulwahn
    Reviewed-by: Lukas Bulwahn
    Acked-by: Joe Perches
    Link: https://lore.kernel.org/linux-kernel-mentees/f5d8124e54a50480b0a9fa638787bc29b6e09854.camel@perches.com/
    Link: https://lkml.kernel.org/r/20200921085436.63003-1-dwaipayanray1@gmail.com
    Signed-off-by: Linus Torvalds

    Dwaipayan Ray
     
  • If a file exists in git and checkpatch is used without the -f flag for
    scanning a file, then checkpatch will scan the file assuming it's a patch
    and emit:

    ERROR: Does not appear to be a unified-diff format patch

    Change the behavior to assume the -f flag if the file exists in git.

    [joe@perches.com: fix git "fatal" warning if file argument outside kernel tree]
    Link: https://lkml.kernel.org/r/b6afa04112d450c2fc120a308d706acd60cee294.camel@perches.com

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Reviewed-by: Julia Lawall
    Cc: Rasmus Villemoes
    Link: https://lkml.kernel.org/r/45b81a48e1568bd0126a96f5046eb7aaae9b83c9.camel@perches.com
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • The uninitialized_var() macro was removed recently via commit 63a0895d960a
    ("compiler: Remove uninitialized_var() macro") as it's not a particularly
    useful warning and its use can "paper over real bugs".

    Add a checkpatch test to warn on self-assignments as a means to avoid
    compiler warnings and as a back-door mechanism to reproduce the old
    uninitialized_var macro behavior.

    [akpm@linux-foundation.org: coding style fixes]

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Cc: Kees Cook
    Cc: Gustavo A. R. Silva
    Cc: Denis Efremov
    Cc: Julia Lawall
    Link: https://lkml.kernel.org/r/afc2cffdd315d3e4394af149278df9e8af7f49f4.camel@perches.com
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • trace_printk is meant as a debugging tool, and should not be compiled into
    production code without specific debug Kconfig options enabled, or source
    code changes, as indicated by the warning that shows up on boot if any
    trace_printk is called:

    ** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **
    ** **
    ** trace_printk() being used. Allocating extra memory. **
    ** **
    ** This means that this is a DEBUG kernel and it is **
    ** unsafe for production use. **

    Let's warn developers when they try to submit such a change.

    Signed-off-by: Nicolas Boichat
    Signed-off-by: Andrew Morton
    Cc: Steven Rostedt
    Cc: Joe Perches
    Link: https://lkml.kernel.org/r/20200825193600.v2.1.I723c43c155f02f726c97501be77984f1e6bb740a@changeid
    Signed-off-by: Linus Torvalds

    Nicolas Boichat
     
  • There are commas used as statement terminations that should typically have
    used semicolons instead. Only direct assignments or use of a single
    function or value on a single line are detected by this test.

    e.g.:
    foo = bar(), /* typical use is semicolon not comma */
    bar = baz();

    Add an imperfect test to detect these comma uses.

    No false positives were found in testing, but many types of false
    negatives are possible.

    e.g.:
    foo = bar() + 1, /* comma use, but not direct assignment */
    bar = baz();

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Link: https://lkml.kernel.org/r/3bf27caf462007dfa75647b040ab3191374a59de.camel@perches.com
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Currently this test only works on .[ch] files.

    Move the test to check more file types and the commit log.

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Link: http://lkml.kernel.org/r/180b3b5677771c902b2e2f7a2b7090ede65fe004.camel@perches.com
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Kconfig allows to customize the CONFIG_ prefix via the $CONFIG_
    environment variable. Out-of-tree projects may therefore use Kconfig with
    a different prefix, or they may use a custom configuration tool which does
    not use the CONFIG_ prefix at all. Such projects may still want to adhere
    to the Linux kernel coding style and run checkpatch.pl.

    One example is OP-TEE [1] which does not use Kconfig but does have
    configuration options prefixed with CFG_. It also mostly follows the
    kernel coding style and therefore being able to use checkpatch is quite
    valuable.

    To make this possible, add the --kconfig-prefix command line option.

    [1] https://github.com/OP-TEE/optee_os

    Signed-off-by: Jerome Forissier
    Signed-off-by: Andrew Morton
    Acked-by: Joe Perches
    Link: http://lkml.kernel.org/r/20200818081732.800449-1-jerome@forissier.org
    Signed-off-by: Linus Torvalds

    Jerome Forissier
     

06 Sep, 2020

1 commit

  • The usage of "capture group (...)" in the immediate condition after `&&`
    results in `$1` being uninitialized. This issues a warning "Use of
    uninitialized value $1 in regexp compilation at ./scripts/checkpatch.pl
    line 2638".

    I noticed this bug while running checkpatch on the set of commits from
    v5.7 to v5.8-rc1 of the kernel on the commits with a diff content in
    their commit message.

    This bug was introduced in the script by commit e518e9a59ec3
    ("checkpatch: emit an error when there's a diff in a changelog"). It
    has been in the script since then.

    The author intended to store the match made by capture group in variable
    `$1`. This should have contained the name of the file as `[\w/]+`
    matched. However, this couldn't be accomplished due to usage of capture
    group and `$1` in the same regular expression.

    Fix this by placing the capture group in the condition before `&&`.
    Thus, `$1` can be initialized to the text that capture group matches
    thereby setting it to the desired and required value.

    Fixes: e518e9a59ec3 ("checkpatch: emit an error when there's a diff in a changelog")
    Signed-off-by: Mrinal Pandey
    Signed-off-by: Andrew Morton
    Tested-by: Lukas Bulwahn
    Reviewed-by: Lukas Bulwahn
    Cc: Joe Perches
    Link: https://lkml.kernel.org/r/20200714032352.f476hanaj2dlmiot@mrinalpandey
    Signed-off-by: Linus Torvalds

    Mrinal Pandey
     

15 Aug, 2020

1 commit

  • Pull Kconfig updates from Masahiro Yamada:

    - remove '---help---' keyword support

    - fix mouse events for 'menuconfig' symbols in search view of qconf

    - code cleanups of qconf

    * tag 'kconfig-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (24 commits)
    kconfig: qconf: move setOptionMode() to ConfigList from ConfigView
    kconfig: qconf: do not limit the pop-up menu to the first row
    kconfig: qconf: refactor icon setups
    kconfig: qconf: remove unused voidPix, menuInvPix
    kconfig: qconf: remove ConfigItem::text/setText
    kconfig: qconf: remove ConfigList::addColumn/removeColumn
    kconfig: qconf: remove ConfigItem::pixmap/setPixmap
    kconfig: qconf: drop more localization code
    kconfig: qconf: remove 'parent' from ConfigList::updateMenuList()
    kconfig: qconf: remove unused argument from ConfigView::updateList()
    kconfig: qconf: remove unused argument from ConfigList::updateList()
    kconfig: qconf: omit parent to QHBoxLayout()
    kconfig: qconf: remove name from ConfigSearchWindow constructor
    kconfig: qconf: remove unused ConfigList::listView()
    kconfig: qconf: overload addToolBar() to create and insert toolbar
    kconfig: qconf: remove toolBar from ConfigMainWindow members
    kconfig: qconf: use 'menu' variable for (QMenu *)
    kconfig: qconf: do not use 'menu' variable for (QMenuBar *)
    kconfig: qconf: remove ->addSeparator() to menuBar
    kconfig: add 'static' to some file-local data
    ...

    Linus Torvalds
     

14 Aug, 2020

1 commit


13 Aug, 2020

5 commits

  • This test doesn't work well and newer compilers are much better
    at emitting this warning.

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Cc: Cambda Zhu
    Link: http://lkml.kernel.org/r/7e25090c79f6a69d502ab8219863300790192fe2.camel@perches.com
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Try to avoid adding repeated words either on the same line or consecutive
    comment lines in a block

    e.g.:

    duplicated word in comment block

    /*
    * this is a comment block where the last word of the previous
    * previous line is also the first word of the next line
    */

    and simple duplication

    /* test this this again */

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Link: http://lkml.kernel.org/r/cda9b566ad67976e1acd62b053de50ee44a57250.camel@perches.com
    Inspired-by: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Checkpatch reports warnings when some specific structs are not declared as
    const in the code. The list of structs to consider was initially defined
    in the checkpatch.pl script itself, but it was later moved to an external
    file (scripts/const_structs.checkpatch), in commit bf1fa1dae68e
    ("checkpatch: externalize the structs that should be const"). This
    introduced two minor issues:

    - When file scripts/const_structs.checkpatch is not present (for
    example, if checkpatch is run outside of the kernel directory with the
    "--no-tree" option), a warning is printed to stderr to tell the user
    that "No structs that should be const will be found". This is fair,
    but the warning is printed unconditionally, even if the option
    "--ignore CONST_STRUCT" is passed. In the latter case, we explicitly
    ask checkpatch to skip this check, so no warning should be printed.

    - When scripts/const_structs.checkpatch is missing, or even when trying
    to silence the warning by adding an empty file, $const_structs is set
    to "", and the regex used for finding structs that should be const,
    "$line =~ /struct\s+($const_structs)(?!\s*\{)/)", matches all
    structs found in the code, thus reporting a number of false positives.

    Let's fix the first item by skipping scripts/const_structs.checkpatch
    processing if "CONST_STRUCT" checks are ignored, and the second one by
    skipping the test if $const_structs is not defined. Since we modify the
    read_words() function a little bit, update the checks for
    $typedefsfile/$typeOtherTypedefs as well.

    Signed-off-by: Quentin Monnet
    Signed-off-by: Andrew Morton
    Acked-by: Joe Perches
    Link: http://lkml.kernel.org/r/20200623221822.3727-1-quentin@isovalent.com
    Signed-off-by: Linus Torvalds

    Quentin Monnet
     
  • Add a --fix option for 2 types of single-line assignment in if statements

    if ((foo = bar(...)) < BAZ) {
    expands to:
    foo = bar(..);
    if (foo < BAZ) {
    and
    if ((foo = bar(...)) {
    expands to:
    foo = bar(...);
    if (foo) {

    if statements with assignments spanning multiple lines are
    not converted with the --fix option.

    if statements with additional logic are also not converted.

    e.g.: if ((foo = bar(...)) & BAZ == BAZ) {

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Cc: Julia Lawall
    Link: http://lkml.kernel.org/r/9bc7c782516f37948f202deba511bc95ed279bbd.camel@perches.com
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • IS_ENABLED is almost always used with CONFIG_ defines.

    Add a test to verify that the #define being tested starts with CONFIG_.

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Reviewed-by: Kees Cook
    Link: http://lkml.kernel.org/r/e7fda760b91b769ba82844ba282d432c0d26d709.camel@perches.com
    Signed-off-by: Linus Torvalds

    Joe Perches
     

05 Aug, 2020

1 commit

  • Pull uninitialized_var() macro removal from Kees Cook:
    "This is long overdue, and has hidden too many bugs over the years. The
    series has several "by hand" fixes, and then a trivial treewide
    replacement.

    - Clean up non-trivial uses of uninitialized_var()

    - Update documentation and checkpatch for uninitialized_var() removal

    - Treewide removal of uninitialized_var()"

    * tag 'uninit-macro-v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    compiler: Remove uninitialized_var() macro
    treewide: Remove uninitialized_var() usage
    checkpatch: Remove awareness of uninitialized_var() macro
    mm/debug_vm_pgtable: Remove uninitialized_var() usage
    f2fs: Eliminate usage of uninitialized_var() macro
    media: sur40: Remove uninitialized_var() usage
    KVM: PPC: Book3S PR: Remove uninitialized_var() usage
    clk: spear: Remove uninitialized_var() usage
    clk: st: Remove uninitialized_var() usage
    spi: davinci: Remove uninitialized_var() usage
    ide: Remove uninitialized_var() usage
    rtlwifi: rtl8192cu: Remove uninitialized_var() usage
    b43: Remove uninitialized_var() usage
    drbd: Remove uninitialized_var() usage
    x86/mm/numa: Remove uninitialized_var() usage
    docs: deprecated.rst: Add uninitialized_var()

    Linus Torvalds
     

21 Jul, 2020

1 commit


17 Jul, 2020

1 commit

  • Using uninitialized_var() is dangerous as it papers over real bugs[1]
    (or can in the future), and suppresses unrelated compiler warnings
    (e.g. "unused variable"). If the compiler thinks it is uninitialized,
    either simply initialize the variable or make compiler changes.

    In preparation for removing[2] the[3] macro[4], partially revert
    commit 16b7f3c89907 ("checkpatch: avoid warning about uninitialized_var()")
    and remove all remaining mentions of uninitialized_var().

    [1] https://lore.kernel.org/lkml/20200603174714.192027-1-glider@google.com/
    [2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/
    [3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/
    [4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/

    Signed-off-by: Kees Cook

    Kees Cook
     

12 Jun, 2020

2 commits

  • Pull the Kernel Concurrency Sanitizer from Thomas Gleixner:
    "The Kernel Concurrency Sanitizer (KCSAN) is a dynamic race detector,
    which relies on compile-time instrumentation, and uses a
    watchpoint-based sampling approach to detect races.

    The feature was under development for quite some time and has already
    found legitimate bugs.

    Unfortunately it comes with a limitation, which was only understood
    late in the development cycle:

    It requires an up to date CLANG-11 compiler

    CLANG-11 is not yet released (scheduled for June), but it's the only
    compiler today which handles the kernel requirements and especially
    the annotations of functions to exclude them from KCSAN
    instrumentation correctly.

    These annotations really need to work so that low level entry code and
    especially int3 text poke handling can be completely isolated.

    A detailed discussion of the requirements and compiler issues can be
    found here:

    https://lore.kernel.org/lkml/CANpmjNMTsY_8241bS7=XAfqvZHFLrVEkv_uM4aDUWE_kh3Rvbw@mail.gmail.com/

    We came to the conclusion that trying to work around compiler
    limitations and bugs again would end up in a major trainwreck, so
    requiring a working compiler seemed to be the best choice.

    For Continous Integration purposes the compiler restriction is
    manageable and that's where most xxSAN reports come from.

    For a change this limitation might make GCC people actually look at
    their bugs. Some issues with CSAN in GCC are 7 years old and one has
    been 'fixed' 3 years ago with a half baken solution which 'solved' the
    reported issue but not the underlying problem.

    The KCSAN developers also ponder to use a GCC plugin to become
    independent, but that's not something which will show up in a few
    days.

    Blocking KCSAN until wide spread compiler support is available is not
    a really good alternative because the continuous growth of lockless
    optimizations in the kernel demands proper tooling support"

    * tag 'locking-kcsan-2020-06-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (76 commits)
    compiler_types.h, kasan: Use __SANITIZE_ADDRESS__ instead of CONFIG_KASAN to decide inlining
    compiler.h: Move function attributes to compiler_types.h
    compiler.h: Avoid nested statement expression in data_race()
    compiler.h: Remove data_race() and unnecessary checks from {READ,WRITE}_ONCE()
    kcsan: Update Documentation to change supported compilers
    kcsan: Remove 'noinline' from __no_kcsan_or_inline
    kcsan: Pass option tsan-instrument-read-before-write to Clang
    kcsan: Support distinguishing volatile accesses
    kcsan: Restrict supported compilers
    kcsan: Avoid inserting __tsan_func_entry/exit if possible
    ubsan, kcsan: Don't combine sanitizer with kcov on clang
    objtool, kcsan: Add kcsan_disable_current() and kcsan_enable_current_nowarn()
    kcsan: Add __kcsan_{enable,disable}_current() variants
    checkpatch: Warn about data_race() without comment
    kcsan: Use GFP_ATOMIC under spin lock
    Improve KCSAN documentation a bit
    kcsan: Make reporting aware of KCSAN tests
    kcsan: Fix function matching in report
    kcsan: Change data_race() to no longer require marking racing accesses
    kcsan: Move kcsan_{disable,enable}_current() to kcsan-checks.h
    ...

    Linus Torvalds
     
  • Merge the state of the locking kcsan branch before the read/write_once()
    and the atomics modifications got merged.

    Squash the fallout of the rebase on top of the read/write once and atomic
    fallback work into the merge. The history of the original branch is
    preserved in tag locking-kcsan-2020-06-02.

    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

11 Jun, 2020

1 commit

  • Adding a new kernel parameter with documentation makes checkpatch complain

    __setup appears un-documented -- check Documentation/admin-guide/kernel-parameters.rst

    The list of kernel parameters has moved to a separate txt file, but
    checkpatch has not been updated for this.

    Make checkpatch.pl look for the documentation for new kernel parameters
    in kernel-parameters.txt instead of kernel-parameters.rst.

    Fixes: e52347bd66f6 ("Documentation/admin-guide: split the kernel parameter list to a separate file")
    Signed-off-by: Tim Froidcoeur
    Signed-off-by: Andrew Morton
    Acked-by: Joe Perches
    Cc: Mauro Carvalho Chehab
    Signed-off-by: Linus Torvalds

    Tim Froidcoeur
     

05 Jun, 2020

5 commits

  • Pull devicetree updates from Rob Herring:

    - Convert various DT (non-binding) doc files to ReST

    - Various improvements to device link code

    - Fix __of_attach_node_sysfs refcounting bug

    - Add support for 'memory-region-names' with reserved-memory binding

    - Vendor prefixes for Protonic Holland, BeagleBoard.org, Alps, Check
    Point, Würth Elektronik, U-Boot, Vaisala, Baikal Electronics,
    Shanghai Awinic Technology Co., MikroTik, Silex Insight

    - A bunch more binding conversions to DT schema. Only 3K to go.

    - Add a minimum version check for schema tools

    - Treewide dropping of 'allOf' usage with schema references. Not needed
    in new json-schema spec.

    - Some formatting clean-ups of schemas

    * tag 'devicetree-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (194 commits)
    dt-bindings: clock: Add documentation for X1830 bindings.
    dt-bindings: mailbox: Convert imx mu to json-schema
    dt-bindings: power: Convert imx gpcv2 to json-schema
    dt-bindings: power: Convert imx gpc to json-schema
    dt-bindings: Merge gpio-usb-b-connector with usb-connector
    dt-bindings: timer: renesas: cmt: Convert to json-schema
    dt-bindings: clock: Convert i.MX8QXP LPCG to json-schema
    dt-bindings: timer: Convert i.MX GPT to json-schema
    dt-bindings: thermal: rcar-thermal: Add device tree support for r8a7742
    dt-bindings: serial: Add binding for UART pin swap
    dt-bindings: geni-se: Add interconnect binding for GENI QUP
    dt-bindings: geni-se: Convert QUP geni-se bindings to YAML
    dt-bindings: vendor-prefixes: Add Silex Insight vendor prefix
    dt-bindings: input: touchscreen: edt-ft5x06: change reg property
    dt-bindings: usb: qcom,dwc3: Introduce interconnect properties for Qualcomm DWC3 driver
    dt-bindings: timer: renesas: mtu2: Convert to json-schema
    of/fdt: Remove redundant kbasename function call
    dt-bindings: clock: Convert i.MX1 clock to json-schema
    dt-bindings: clock: Convert i.MX21 clock to json-schema
    dt-bindings: clock: Convert i.MX25 clock to json-schema
    ...

    Linus Torvalds
     
  • While "git am" can apply an mbox file containing multiple patches (e.g.
    as created by b4[1], or a patch bundle downloaded from patchwork),
    checkpatch does not have proper support for that. When operating on an
    mbox, checkpatch will merge all detected tags, and complain falsely about
    duplicates:

    WARNING: Duplicate signature

    As modifying checkpatch to reset state in between each patch is a lot of
    work, a simple solution is splitting the mbox into individual patches, and
    invoking checkpatch for each of them. Fortunately checkpatch can read a
    patch from stdin, so the classic "formail" tool can be used to split the
    mbox, and pipe all individual patches to checkpatch:

    formail -s scripts/checkpatch.pl < my-mbox

    However, when reading a patch file from standard input, checkpatch calls
    it "Your patch", and reports its state as:

    Your patch has style problems, please review.

    or:

    Your patch has no obvious style problems and is ready for submission.

    Hence it can be difficult to identify which patches need to be reviewed
    and improved.

    Fix this by replacing "Your patch" by (the first line of) the email
    subject, if present.

    Note that "git mailsplit" can also be used to split an mbox, but it will
    create individual files for each patch, thus requiring cleanup afterwards.
    Formail does not have this disadvantage.

    [1] https://git.kernel.org/pub/scm/utils/b4/b4.git

    [joe@perches.com: reduce cpu usage]
    Link: http://lkml.kernel.org/r/c9d89bb24c7414142414c60371e210fdcf4617d2.camel@perches.com
    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Cc: Joe Perches
    Cc: Konstantin Ryabitsev
    Link: http://lkml.kernel.org/r/20200505132613.17452-1-geert+renesas@glider.be
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     
  • Don't allow these options to be combined.

    Miscellanea:

    o Add missing $P: to some die("reason message") output

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Link: http://lkml.kernel.org/r/3dc7bdaa58490f5906efc11a4d6113e42a087723.camel@perches.com
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Some checks look for comments around a specific function like
    read_barrier_depends.

    Extend the check to support both c89 and c90 comment styles.

    c89 /* comment */
    or
    c99 // comment

    For c99 comments, only look a 3 single lines, the line being scanned,
    the line above and the line below the line being scanned rather than
    the patch diff context.

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Tested-by: Paul E. McKenney
    Cc: Marco Elver
    Cc: Dmitry Vyukov
    Cc: Alexander Potapenko
    Cc: Andrey Konovalov
    Cc: Andy Whitcroft
    Cc: Will Deacon
    Link: http://lkml.kernel.org/r/65cb075435d2f385a53c77571b491b2b09faaf8e.camel@perches.com
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • There is a preferred order for the entries in MAINTAINERS sections.

    See commits 3b50142d8528 ("MAINTAINERS: sort field names for all
    entries") and 6680125ea5a2 ("MAINTAINERS: list the section entries in
    the preferred order")

    Add checkpatch tests to try to keep that ordering.

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Acked-by: Andy Shevchenko
    Link: http://lkml.kernel.org/r/17677130b3ca62d79817e6a22546bad39d7e81b4.camel@perches.com
    Signed-off-by: Linus Torvalds

    Joe Perches
     

01 Jun, 2020

2 commits

  • xdp_umem.c had overlapping changes between the 64-bit math fix
    for the calculation of npgs and the removal of the zerocopy
    memory type which got rid of the chunk_size_nohdr member.

    The mlx5 Kconfig conflict is a case where we just take the
    net-next copy of the Kconfig entry dependency as it takes on
    the ESWITCH dependency by one level of indirection which is
    what the 'net' conflicting change is trying to ensure.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Yes, staying withing 80 columns is certainly still _preferred_. But
    it's not the hard limit that the checkpatch warnings imply, and other
    concerns can most certainly dominate.

    Increase the default limit to 100 characters. Not because 100
    characters is some hard limit either, but that's certainly a "what are
    you doing" kind of value and less likely to be about the occasional
    slightly longer lines.

    Miscellanea:

    - to avoid unnecessary whitespace changes in files, checkpatch will no
    longer emit a warning about line length when scanning files unless
    --strict is also used

    - Add a bit to coding-style about alignment to open parenthesis

    Signed-off-by: Joe Perches
    Signed-off-by: Linus Torvalds

    Joe Perches
     

12 May, 2020

1 commit

  • ENOTSUPP often feels like the right error code to use, but it's
    in fact not a standard Unix error. E.g.:

    $ python
    >>> import errno
    >>> errno.errorcode[errno.ENOTSUPP]
    Traceback (most recent call last):
    File "", line 1, in
    AttributeError: module 'errno' has no attribute 'ENOTSUPP'

    There were numerous commits converting the uses back to EOPNOTSUPP
    but in some cases we are stuck with the high error code for backward
    compatibility reasons.

    Let's try prevent more ENOTSUPPs from getting into the kernel.

    Recent example:
    https://lore.kernel.org/netdev/20200510182252.GA411829@lunn.ch/

    v3 (Joe):
    - fix the "not file" condition.

    v2 (Joe):
    - add a link to recent discussion,
    - don't match when scanning files, not patches to avoid sudden
    influx of conversion patches.
    https://lore.kernel.org/netdev/20200511165319.2251678-1-kuba@kernel.org/

    v1:
    https://lore.kernel.org/netdev/20200510185148.2230767-1-kuba@kernel.org/

    Suggested-by: Andrew Lunn
    Signed-off-by: Jakub Kicinski
    Acked-by: Joe Perches
    Signed-off-by: David S. Miller

    Jakub Kicinski
     

08 May, 2020

1 commit


07 May, 2020

1 commit


05 May, 2020

1 commit


22 Apr, 2020

1 commit

  • Here, we look for function such as 'netdev_alloc_skb_ip_align', so a '_'
    is missing in the regex.

    To make sure:
    grep -r --include=*.c skbip_a * | wc ==> 0 results
    grep -r --include=*.c skb_ip_a * | wc ==> 112 results

    Signed-off-by: Christophe JAILLET
    Signed-off-by: Andrew Morton
    Acked-by: Joe Perches
    Link: http://lkml.kernel.org/r/20200407190029.892-1-christophe.jaillet@wanadoo.fr
    Signed-off-by: Linus Torvalds

    Christophe JAILLET
     

08 Apr, 2020

1 commit

  • WARNING: function definition argument 'flags' should also have an identifier name
    #26: FILE: drivers/tty/serial/sh-sci.c:1348:
    + unsigned long uninitialized_var(flags);

    Special-case uninitialized_var() to prevent this.

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Tested-by: Andrew Morton
    Link: http://lkml.kernel.org/r/7db7944761b0bd88c70eb17d4b7f40fe589e14ed.camel@perches.com
    Signed-off-by: Linus Torvalds

    Joe Perches