12 Oct, 2016

14 commits

  • Vim, with the omnicppcomplete(#1) plugin, can do code completion using
    information build by ctags. Add flags needed by omnicppcomplete(#2) to
    have completion on member of structure.

    1: https://github.com/vim-scripts/omnicppcomplete
    2: https://github.com/vim-scripts/OmniCppComplete/blob/master/doc/omnicppcomplete.txt#L93

    Link: http://lkml.kernel.org/r/20160830191546.4469-1-mathieu.maret@gmail.com
    Signed-off-by: Mathieu Maret
    Cc: Michal Marek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Maret
     
  • The function calls with octal permissions commonly span multiple lines.
    The current test is line oriented and fails to find some matches.

    Make the test use the $stat variable instead of the $line variable to span
    multiple lines.

    Also add a few functions to the known functions with permissions list.

    Move the SYMBOLIC_PERMS test to a separate section to find all the S_
    permissions in any form not just those that have specific function names.

    This can now find and fix permissions uses like:
    .mode = S_ | S_;

    Link: http://lkml.kernel.org/r/b51bab60530912aae4ac420119d465c5b206f19f.1475030406.git.joe@perches.com
    Signed-off-by: Joe Perches
    Tested-by: Ramiro Oliveira
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Function definitions without identifiers like
    int foo(int)
    are not preferred. Emit a warning when they occur.

    Link: http://lkml.kernel.org/r/94fe6378504745991b650f48fc92bb4648f25706.1474925354.git.joe@perches.com
    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • It is possible for a multiple line macro definition to have a false positive
    report when an argument is used on a line after a continuation \.

    This line might have a leading '+' as the initial character that could be
    confused by checkpatch as an operator.

    Avoid the leading character on multiple line macro definitions.

    Link: http://lkml.kernel.org/r/60229d13399f9b6509db5a32e30d4c16951a60cd.1473836073.git.joe@perches.com
    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Add a test for macro arguents that have a non-comma leading or trailing
    operator where the argument isn't parenthesized to avoid possible precedence
    issues.

    Link: http://lkml.kernel.org/r/47715508972f8d786f435e583ff881dbeee3a114.1473745855.git.joe@perches.com
    Signed-off-by: Joe Perches
    Cc: Andy Whitcroft
    Cc: Julia Lawall
    Cc: Dan Carpenter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • If a macro argument is used multiple times in the macro definition, the
    macro argument may have an unexpected side-effect.

    Add a test (MACRO_ARG_REUSE) for that condition which is only
    emitted with command-line option --strict.

    Link: http://lkml.kernel.org/r/b6d67a87cafcafd15499e91780dc63b15dec0aa0.1473744906.git.joe@perches.com
    Signed-off-by: Joe Perches
    Cc: Andy Whitcroft
    Cc: Julia Lawall
    Cc: Dan Carpenter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • An "uninitialized value" is emitted when a block comment starts on
    the same line as a statement.

    Fix this and make the test use a little fewer cpu cycles too.

    Link: http://lkml.kernel.org/r/3c9993320c2182d37f53ac540878cfef59c3f62d.1473365956.git.joe@perches.com
    Signed-off-by: Joe Perches
    Reported-by: Charlemagne Lasse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Adding -f to the get_maintainer.pl invocation means git isn't invoked
    by get_maintainer.pl for known filenames.

    This reduces the overall time to run checkpatch.

    Link: http://lkml.kernel.org/r/22991e3a295aeb399b43af0478b6e5809106ccee.1472684066.git.joe@perches.com
    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Using const is generally a good idea.

    Julia Lawall has created a list of always const and almost always const
    structs in the kernel sources.

    Link: https://lkml.org/lkml/2016/8/28/95

    Add the most frequently used (> 50 cases) that are almost always or
    always const.

    Link: http://lkml.kernel.org/r/1e16020f8027654db0095bbfbcc11da51025365c.1472664220.git.joe@perches.com
    Signed-off-by: Joe Perches
    Acked-by: Kees Cook
    Cc: Julia Lawall
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Make it easier to add new structs that should be const.

    Link: http://lkml.kernel.org/r/e5a8da43e7c11525bafbda1ca69a8323614dd942.1472664220.git.joe@perches.com
    Signed-off-by: Joe Perches
    Cc: Julia Lawall
    Cc: Kees Cook
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • < sigh > Comment these tests out.

    These are just too enticing to people that don't verify that
    both source and dest addresses really must be __aligned(2).

    It helps make Dan Carpenter happy too.

    Link: http://lkml.kernel.org/r/dc32ec66d24647f4cdf824c8dfbbc59aa7ce7b7d.1472665676.git.joe@perches.com
    Signed-off-by: Joe Perches
    Cc: Dan Carpenter
    Cc: Greg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Warn when block comments are not aligned on the *

    /*
    * block comment, no warning
    */

    /*
    * block comment, emit warning
    */

    Link: http://lkml.kernel.org/r/edb57bd330adfe024b95ec2a807d4aa7f0c8b112.1472261299.git.joe@perches.com
    Signed-off-by: Joe Perches
    Reported-by: Sudip Mukherjee
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • S_ uses should be avoided where octal is more intelligible.

    Linus didst say:

    : It's *much* easier to parse and understand the octal numbers, while the
    : symbolic macro names are just random line noise and hard as hell to
    : understand. You really have to think about it.
    :
    : So we should rather go the other way: convert existing bad symbolic
    : permission bit macro use to just use the octal numbers.
    :
    : The symbolic names are good for the *other* bits (ie sticky bit, and the
    : inode mode _type_ numbers etc), but for the permission bits, the symbolic
    : names are just insane crap. Nobody sane should ever use them. Not in the
    : kernel, not in user space.
    (http://lkml.kernel.org/r/CA+55aFw5v23T-zvDZp-MmD_EYxF8WbafwwB59934FV7g21uMGQ@mail.gmail.com)

    Link: http://lkml.kernel.org/r/7232ef011d05a92f4caa86a5e9830d87966a2eaf.1470180926.git.joe@perches.com
    Signed-off-by: Joe Perches
    Cc: Linus Torvalds
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Use get_maintainer to check the status of individual files. If
    "obsolete", suggest leaving the files alone.

    Link: http://lkml.kernel.org/r/7ceaa510dc9d2df05ec4b456baed7bb1415550b3.1471889575.git.joe@perches.com
    Signed-off-by: Joe Perches
    Cc: SF Markus Elfring
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     

08 Oct, 2016

2 commits

  • No need to correct the correct.

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

    Joe Perches
     
  • When doing an nmi backtrace of many cores, most of which are idle, the
    output is a little overwhelming and very uninformative. Suppress
    messages for cpus that are idling when they are interrupted and just
    emit one line, "NMI backtrace for N skipped: idling at pc 0xNNN".

    We do this by grouping all the cpuidle code together into a new
    .cpuidle.text section, and then checking the address of the interrupted
    PC to see if it lies within that section.

    This commit suitably tags x86 and tile idle routines, and only adds in
    the minimal framework for other architectures.

    Link: http://lkml.kernel.org/r/1472487169-14923-5-git-send-email-cmetcalf@mellanox.com
    Signed-off-by: Chris Metcalf
    Acked-by: Peter Zijlstra (Intel)
    Tested-by: Peter Zijlstra (Intel)
    Tested-by: Daniel Thompson [arm]
    Tested-by: Petr Mladek
    Cc: Aaron Tomlin
    Cc: Peter Zijlstra (Intel)
    Cc: "Rafael J. Wysocki"
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Metcalf
     

07 Oct, 2016

1 commit

  • Pull tracing updates from Steven Rostedt:
    "This release cycle is rather small. Just a few fixes to tracing.

    The big change is the addition of the hwlat tracer. It not only
    detects SMIs, but also other latency that's caused by the hardware. I
    have detected some latency from large boxes having bus contention"

    * tag 'trace-v4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    tracing: Call traceoff trigger after event is recorded
    ftrace/scripts: Add helper script to bisect function tracing problem functions
    tracing: Have max_latency be defined for HWLAT_TRACER as well
    tracing: Add NMI tracing in hwlat detector
    tracing: Have hwlat trace migrate across tracing_cpumask CPUs
    tracing: Add documentation for hwlat_detector tracer
    tracing: Added hardware latency tracer
    ftrace: Access ret_stack->subtime only in the function profiler
    function_graph: Handle TRACE_BPUTS in print_graph_comment
    tracing/uprobe: Drop isdigit() check in create_trace_uprobe

    Linus Torvalds
     

05 Oct, 2016

2 commits

  • Pull s390 updates from Martin Schwidefsky:
    "The new features and main improvements in this merge for v4.9

    - Support for the UBSAN sanitizer

    - Set HAVE_EFFICIENT_UNALIGNED_ACCESS, it improves the code in some
    places

    - Improvements for the in-kernel fpu code, in particular the overhead
    for multiple consecutive in kernel fpu users is recuded

    - Add a SIMD implementation for the RAID6 gen and xor operations

    - Add RAID6 recovery based on the XC instruction

    - The PCI DMA flush logic has been improved to increase the speed of
    the map / unmap operations

    - The time synchronization code has seen some updates

    And bug fixes all over the place"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (48 commits)
    s390/con3270: fix insufficient space padding
    s390/con3270: fix use of uninitialised data
    MAINTAINERS: update DASD maintainer
    s390/cio: fix accidental interrupt enabling during resume
    s390/dasd: add missing \n to end of dev_err messages
    s390/config: Enable config options for Docker
    s390/dasd: make query host access interruptible
    s390/dasd: fix panic during offline processing
    s390/dasd: fix hanging offline processing
    s390/pci_dma: improve lazy flush for unmap
    s390/pci_dma: split dma_update_trans
    s390/pci_dma: improve map_sg
    s390/pci_dma: simplify dma address calculation
    s390/pci_dma: remove dma address range check
    iommu/s390: simplify registration of I/O address translation parameters
    s390: migrate exception table users off module.h and onto extable.h
    s390: export header for CLP ioctl
    s390/vmur: fix irq pointer dereference in int handler
    s390/dasd: add missing KOBJ_CHANGE event for unformatted devices
    s390: enable UBSAN
    ...

    Linus Torvalds
     
  • Pull documentation updates from Jonathan Corbet:
    "This is the documentation update pull for the 4.9 merge window.

    The Sphinx transition is still creating a fair amount of work. Here we
    have a number of fixes and, importantly, a proper PDF output solution,
    thanks to Jani Nikula, Mauro Carvalho Chehab and Markus Heiser.

    I've started a couple of new books: a driver API book (based on the
    old device-drivers.tmpl) and a development tools book. Both are meant
    to show how we can integrate together our existing documentation into
    a more coherent and accessible whole. It involves moving some stuff
    around and formatting changes, but, I think, the results are worth it.
    The good news is that most of our existing Documentation/*.txt files
    are *almost* in RST format already; the amount of messing around
    required is minimal.

    And, of course, there's the usual set of updates, typo fixes, and
    more"

    * tag 'docs-4.9' of git://git.lwn.net/linux: (120 commits)
    URL changed for Linux Foundation TAB
    dax : Fix documentation with respect to struct pages
    iio: Documentation: Correct the path used to create triggers.
    docs: Remove space-before-label guidance from CodingStyle
    docs-rst: add inter-document cross references
    Documentation/email-clients.txt: convert it to ReST markup
    Documentation/kernel-docs.txt: reorder based on timestamp
    Documentation/kernel-docs.txt: Add dates for online docs
    Documentation/kernel-docs.txt: get rid of broken docs
    Documentation/kernel-docs.txt: move in-kernel docs
    Documentation/kernel-docs.txt: remove more legacy references
    Documentation/kernel-docs.txt: add two published books
    Documentation/kernel-docs.txt: sort books per publication date
    Documentation/kernel-docs.txt: adjust LDD references
    Documentation/kernel-docs.txt: some improvements on the ReST output
    Documentation/kernel-docs.txt: Consistent indenting: 4 spaces
    Documentation/kernel-docs.txt: Add 4 paper/book references
    Documentation/kernel-docs.txt: Improve layouting of book list
    Documentation/kernel-docs.txt: Remove offline or outdated entries
    docs: Clean up bare :: lines
    ...

    Linus Torvalds
     

04 Oct, 2016

1 commit

  • Pull char/misc driver updates from Greg KH:
    "Here's the "big" char and misc driver update for 4.9-rc1.

    Lots of little things here, all over the driver tree for subsystems
    that flow through me. Nothing major that I can discern, full details
    are in the shortlog.

    All have been in the linux-next tree with no reported issues"

    * tag 'char-misc-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (144 commits)
    drivers/misc/hpilo: Changes to support new security states in iLO5 FW
    at25: fix debug and error messaging
    misc/genwqe: ensure zero initialization
    vme: fake: remove unexpected unlock in fake_master_set()
    vme: fake: mark symbols static where possible
    spmi: pmic-arb: Return an error code if sanity check fails
    Drivers: hv: get rid of id in struct vmbus_channel
    Drivers: hv: make VMBus bus ids persistent
    mcb: Add a dma_device to mcb_device
    mcb: Enable PCI bus mastering by default
    mei: stop the stall timer worker if not needed
    clk: probe common clock drivers earlier
    vme: fake: fix build for 64-bit dma_addr_t
    ttyprintk: Neaten and simplify printing
    mei: me: add kaby point device ids
    coresight: tmc: mark symbols static where possible
    coresight: perf: deal with error condition properly
    Drivers: hv: hv_util: Avoid dynamic allocation in time synch
    fpga manager: Add hardware dependency to Zynq driver
    Drivers: hv: utils: Support TimeSync version 4.0 protocol samples.
    ...

    Linus Torvalds
     

29 Sep, 2016

1 commit

  • be7635e7287e ("arch, ftrace: for KASAN put hard/soft IRQ entries into
    separate sections") added .softirqentry.text section, but it was not added
    to recordmcount. So functions in the section are untracable. Add the
    section to scripts/recordmcount.c and scripts/recordmcount.pl.

    Fixes: be7635e7287e ("arch, ftrace: for KASAN put hard/soft IRQ entries into separate sections")
    Link: http://lkml.kernel.org/r/1474902626-73468-1-git-send-email-dvyukov@google.com
    Signed-off-by: Dmitry Vyukov
    Acked-by: Steve Rostedt
    Cc: [4.6+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitry Vyukov
     

22 Sep, 2016

1 commit

  • Every so often, with a special config or a architecture change, running
    function or function_graph tracing can cause the machien to hard reboot,
    crash, or simply hard lockup. There's some functions in the function graph
    tracer that can not be traced otherwise it causes the function tracer to
    recurse before the recursion protection mechanisms are in place.

    When this occurs, using the dynamic ftrace featuer that allows limiting what
    actually gets traced can be used to bisect down to the problem function.
    This adds a script that helps with this process in the scripts/tracing
    directory, called ftrace-bisect.sh

    The set up is to read all the functions that can be traced from
    available_filter_functions into a file (full_file). Then run this script
    passing it the full_file and a "test_file" and "non_test_file", where the
    test_file will be add to set_ftrace_filter. What ftarce_bisect.sh does, is
    to copy half of the functions in full_file into the test_file and the other
    half into the non_test_file. This way, one can cat the test_file into the
    set_ftrace_filter functions and only test the functions that are in that
    file. If it works, then we run the process again after copying non_test_file
    to full_file and repeating the process. If the system crashed, then the bad
    function is in the test_file and after a reboot, the test_file becomes the
    new full_file in the next iteration.

    When we get down to a single function in the full_file, then
    ftrace_bisect.sh will report that as the bad function.

    Full documentation of how to use this simple script is within the script
    file itself.

    Link: http://lkml.kernel.org/r/20160920100716.131d3647@gandalf.local.home

    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     

20 Sep, 2016

3 commits

  • Some architectures use a hardware defined structure at address zero.
    Checking for a null pointer will result in many ubsan reports.
    Allow users to disable the null sanitizer.

    Signed-off-by: Christian Borntraeger
    Acked-by: Andrey Ryabinin
    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Christian Borntraeger
     
  • Due to our compiler include directives, the build pathnames for header
    files often end up being of the form "$srcdir/./include/linux/xyz.h",
    which ends up having that extra "." path component after the build base
    in it.

    Teach faddr2line to skip that too, to make code generated in inline
    functions in header files match the filename for the regular C files.

    Rabin Vincent pointed out that I can't make a stricter regexp match by
    using the " at " prefix for the pathname, because that ends up being
    locale-dependent. But this does require that the path match be preceded
    by a space, to make it a bit more strict (that matters mainly if we
    didn't find any base_dir at all, and we only end up with the "./" part
    of the match)

    Acked-by: Josh Poimboeuf
    Cc: Rabin Vincent
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • addr2line doesn't work with KASLR addresses. Add a basic addr2line
    wrapper script which takes the 'func+offset/size' format as input.

    Signed-off-by: Josh Poimboeuf
    Signed-off-by: Linus Torvalds

    Josh Poimboeuf
     

06 Sep, 2016

3 commits


05 Sep, 2016

1 commit


02 Sep, 2016

1 commit


01 Sep, 2016

2 commits

  • When using a typedef function like this one:
    typedef bool v4l2_check_dv_timings_fnc (const struct v4l2_dv_timings * t, void * handle);

    The Sphinx C domain expects it to create a c:type: reference,
    as that's the way it creates the type references when parsing
    a c:function:: declaration.

    So, a declaration like:

    .. c:function:: bool v4l2_valid_dv_timings (const struct v4l2_dv_timings * t, const struct v4l2_dv_timings_cap * cap, v4l2_check_dv_timings_fnc fnc, void * fnc_handle)

    Will create a cross reference for :c:type:`v4l2_check_dv_timings_fnc`.

    So, when outputting such typedefs in RST format, we need to handle
    this special case, as otherwise it will produce those warnings:

    ./include/media/v4l2-dv-timings.h:43: WARNING: c:type reference target not found: v4l2_check_dv_timings_fnc
    ./include/media/v4l2-dv-timings.h:60: WARNING: c:type reference target not found: v4l2_check_dv_timings_fnc
    ./include/media/v4l2-dv-timings.h:81: WARNING: c:type reference target not found: v4l2_check_dv_timings_fnc

    So, change the kernel-doc script to produce a RST output for the
    above typedef as:
    .. c:type:: v4l2_check_dv_timings_fnc

    **Typedef**: timings check callback

    **Syntax**

    ``bool v4l2_check_dv_timings_fnc (const struct v4l2_dv_timings * t, void * handle);``

    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Jonathan Corbet

    Mauro Carvalho Chehab
     
  • Improve the parser to handle typedefs like:

    typedef bool v4l2_check_dv_timings_fnc(const struct v4l2_dv_timings *t, void *handle);

    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

31 Aug, 2016

3 commits

  • ver_linux.awk renamed to ver_linux.

    Signed-off-by: Alexander Kapshuk
    Signed-off-by: Greg Kroah-Hartman

    Alexander Kapshuk
     
  • The shell implementation removed. To be replaced with an all-awk implementation via consecutive patch.

    Signed-off-by: Alexander Kapshuk
    Signed-off-by: Greg Kroah-Hartman

    Alexander Kapshuk
     
  • The algorithm that extracts the version number of the utility being
    queried, and prints the name of the utility and its version number is
    currently implemented in awk. The code is used throughout the script,
    making its use repetative. The proposed implementation confines the
    algorithm in question to a function, which makes the script easier to
    read overall, as well as considerably reduces the number of lines of
    code. Every attempt has been made to retain the look and the format
    generated by the current implementation.

    Signed-off-by: Alexander Kapshuk
    Signed-off-by: Greg Kroah-Hartman

    Alexander Kapshuk
     

28 Aug, 2016

5 commits