13 Apr, 2014

1 commit

  • Pull misc kbuild changes from Michal Marek:
    "Here is the non-critical part of kbuild:
    - One bogus coccinelle check removed, one check fixed not to suggest
    the obsolete PTR_RET macro
    - scripts/tags.sh does not index the generated *.mod.c files
    - new objdiff tool to list differences between two versions of an
    object file
    - A fix for scripts/bootgraph.pl"

    * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    scripts/coccinelle: Use PTR_ERR_OR_ZERO
    scripts/bootgraph.pl: Add graphic header
    scripts: objdiff: detect object code changes between two commits
    Coccicheck: Remove memcpy to struct assignment test
    scripts/tags.sh: Ignore *.mod.c

    Linus Torvalds
     

10 Apr, 2014

2 commits


08 Apr, 2014

5 commits

  • PTR_RET is deprecated. Do not recommend its usage anymore.
    Use PTR_ERR_OR_ZERO instead.

    Signed-off-by: Sachin Kamat
    Signed-off-by: Michal Marek

    Sachin Kamat
     
  • Adding -header + help function like other .pl in /scripts.

    Signed-off-by: Fabian Frederick
    Signed-off-by: Michal Marek

    Fabian Frederick
     
  • objdiff is useful when doing large code cleanups. For example, when
    removing checkpatch warnings and errors from new drivers in the staging
    tree.

    objdiff can be used in conjunction with a git rebase to confirm that
    each commit made no changes to the resulting object code. It has the
    same return values as diff(1).

    This was written specifically to support adding the skein and threefish
    cryto drivers to the staging tree. I needed a programmatic way to
    confirm that commits changing >90% of the lines didn't inadvertently
    change the code.

    Temporary files (objdump output) are stored in

    /path/to/linux/.tmp_objdiff

    'make mrproper' will remove this directory.

    Signed-off-by: Jason Cooper
    Signed-off-by: Michal Marek

    Jason Cooper
     
  • Pull kbuild changes from Michal Marek:
    - cleanups in the main Makefiles and Documentation/DocBook/Makefile
    - make O=... directory is automatically created if needed
    - mrproper/distclean removes the old include/linux/version.h to make
    life easier when bisecting across the commit that moved the version.h
    file

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    kbuild: docbook: fix the include error when executing "make help"
    kbuild: create a build directory automatically for out-of-tree build
    kbuild: remove redundant '.*.cmd' pattern from make distclean
    kbuild: move "quote" to Kbuild.include to be consistent
    kbuild: docbook: use $(obj) and $(src) rather than specific path
    kbuild: unconditionally clobber include/linux/version.h on distclean
    kbuild: docbook: specify KERNELDOC dependency correctly
    kbuild: docbook: include cmd files more simply
    kbuild: specify build_docproc as a phony target

    Linus Torvalds
     
  • "make allnoconfig" exists to ease testing of minimal configurations.
    Documentation/SubmitChecklist includes a note to test with allnoconfig.
    This helps catch missing dependencies on common-but-not-required
    functionality, which might otherwise go unnoticed.

    However, allnoconfig still leaves many symbols enabled, because they're
    hidden behind CONFIG_EMBEDDED or CONFIG_EXPERT. For instance, allnoconfig
    still has CONFIG_PRINTK and CONFIG_BLOCK enabled, so drivers don't
    typically get build-tested with those disabled.

    To address this, introduce a new Kconfig option "allnoconfig_y", used on
    symbols which only exist to hide other symbols. Set it on CONFIG_EMBEDDED
    (which then selects CONFIG_EXPERT). allnoconfig will then disable all the
    symbols hidden behind those.

    Signed-off-by: Josh Triplett
    Tested-by: Paul E. McKenney
    Cc: Michal Marek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Josh Triplett
     

07 Apr, 2014

1 commit

  • Pull module updates from Rusty Russell:
    "Nothing major: the stricter permissions checking for sysfs broke a
    staging driver; fix included. Greg KH said he'd take the patch but
    hadn't as the merge window opened, so it's included here to avoid
    breaking build"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    staging: fix up speakup kobject mode
    Use 'E' instead of 'X' for unsigned module taint flag.
    VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms.
    kallsyms: fix percpu vars on x86-64 with relocation.
    kallsyms: generalize address range checking
    module: LLVMLinux: Remove unused function warning from __param_check macro
    Fix: module signature vs tracepoints: add new TAINT_UNSIGNED_MODULE
    module: remove MODULE_GENERIC_TABLE
    module: allow multiple calls to MODULE_DEVICE_TABLE() per module
    module: use pr_cont

    Linus Torvalds
     

04 Apr, 2014

23 commits

  • This test prevents code from being aligned around the : for easy visual
    counting of bitfield lengths.

    ie:
    int foo : 1,
    int bar : 2,
    int foobar :29;

    should be acceptable so remove the test.

    Signed-off-by: Joe Perches
    Suggested-by: Dan Carpenter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Currently the parenthesis alignment test works only on misalignments of
    if statements like

    if (foo(bar,
    baz)

    Expand the test to find misalignments like:

    static inline int foo(int bar,
    int baz)

    and

    foo(bar,
    baz);

    and

    foo = bar(baz,
    qux);

    Expand the $Inline keyword for __inline and __inline__ too.
    Add $Inline to $Declare so it also matches "static inline ".

    These checks are only performed with --strict.

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

    Joe Perches
     
  • A commit hook for the Gerrit code review server [1] inserts change
    identifiers so Gerrit can track patches through multiple revisions.
    These identifiers are noise in the context of the upstream kernel.
    (Many Gerrit servers are private. Even given a public instance, given
    only a Change-Id, one must guess which server a change was tracked on.
    Patches submitted to the Linux kernel mailing lists should be able to
    stand on their own. If it's truly useful to reference code review on a
    Gerrit server, a URL is a much clearer way to do so.) Thus, issue an
    error when a Change-Id line is encountered before the Signed-off-by.

    1. https://gerrit.googlesource.com/gerrit/+/master/gerrit-server/src/main/resources/com/google/gerrit/server/tools/root/hooks/commit-msg

    Signed-off-by: Christopher Covington
    Cc: Joe Perches
    Cc: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christopher Covington
     
  • Revert commit 7e4915e78992 ("checkpatch: add warning of future
    __GFP_NOFAIL use").

    There are no plans to remove __GFP_NOFAIL.

    __GFP_NOFAIL exists to

    a) centralise the retry-allocation-for-ever operation into the core
    allocator, which is the appropriate implementation site and

    b) permit us to identify code sites which aren't handling memory
    exhaustion appropriately.

    Cc: David Rientjes
    Cc: Joe Perches
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • Networking prefers this style, so warn when it's not used.

    Networking uses:

    void foo(int bar)
    {
    int baz;

    code...
    }

    not

    void foo(int bar)
    {
    int baz;
    code...
    }

    There are a limited number of false positives when using macros to
    declare variables like:

    WARNING: networking uses a blank line after declarations
    #330: FILE: net/ipv4/inet_hashtables.c:330:
    + int dif = sk->sk_bound_dev_if;
    + INET_ADDR_COOKIE(acookie, saddr, daddr)

    Signed-off-by: Joe Perches
    Cc: David Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Improve the vendor name match in vendor-prefix.txt by only matching the
    exact vendor name at the beginning of lines.

    Signed-off-by: Florian Vaussard
    Cc: Joe Perches
    Acked-by: Rob Herring
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Florian Vaussard
     
  • Look for ".compatible = "foo" strings not only in .dts files, but
    in .c and .h too.

    Signed-off-by: Florian Vaussard
    Cc: Joe Perches
    Acked-by: Rob Herring
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Florian Vaussard
     
  • With a compatible string like

    compatible = "foo";

    checkpatch will currently try to find "foo" in vendor-prefixes.txt,
    which is wrong since the vendor prefix is empty in this specific case.

    Skip the vendor test if the compatible is not like

    compatible = "vendor,something";

    Signed-off-by: Florian Vaussard
    Cc: Joe Perches
    Acked-by: Rob Herring
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Florian Vaussard
     
  • The current vendor compatible check will not match vendors with dashes,
    like:

    compatible="asahi-kasei"

    Signed-off-by: Florian Vaussard
    Reported-by: Joe Perches
    Acked-by: Rob Herring
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Florian Vaussard
     
  • The current octal permissions test is very slow.

    When patch ("checkpatch: add checks for constant non-octal permissions")
    was added, processing time approximately tripled.

    Regain almost all of the performance by not looping through all the
    possible functions unless the line contains one of the functions.

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

    Joe Perches
     
  • Modify warning message when printk is used in a patch. It mentions to
    use subsystem_dbg instead of netdev_dbg as the first preferred format of
    logging debug messages.

    Signed-off-by: Yogesh Chaudhari
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yogesh Chaudhari
     
  • This test is a bit noisy and opinions seem to agree that it should not
    warn in a lot more situations.

    It seems people agree that:

    return (foo || bar);
    and
    return foo || bar;

    are both acceptable style and checkpatch should be silent about them.

    For now, it warns on parentheses around a simple constant or a single
    function or a ternary.

    return (foo);
    return (foo(bar));
    return (foo ? bar : baz);

    The last ternary test may be quieted in the future.

    Modify the deparenthesize function to only strip balanced leading and
    trailing parentheses.

    Signed-off-by: Joe Perches
    Cc: Julia Lawall
    Reviewed-by: Josh Triplett
    Cc: Monam Agarwal
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • It's very common to have normal block comments for the initial comments
    of a file description preface.

    So for files in drivers/net and net/ don't emit a warning when the first
    comment block in the file uses the normal block comment style and not
    the networking block comment style.

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

    Joe Perches
     
  • Instead of array indexing $_, use temporary variables like all the other
    subroutines in the script use.

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

    Joe Perches
     
  • static const char* arrays create smaller text as each function call does
    not have to populate the array.

    Emit a warning when char *arrays aren't static const and the array is
    not apparently global by being declared in the first column.

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

    Joe Perches
     
  • checkpatch could not distinguish between a variable in a struct named
    jiffies and the normal jiffies.

    foo->jiffies

    would emit a "Comparing jiffies" arning.

    Update the $Compare variable to do a negative look-behind for "-" when
    finding a ">" so that a pointer dereference like -> isn't a comparison.

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

    Joe Perches
     
  • Change a test of $dstat to $line to avoid possibly emitting the sscanf
    warning multiple times.

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

    Joe Perches
     
  • When checking permissions, make sure 4 octal digits are used, but allow
    a single 0 too.

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

    Joe Perches
     
  • Emit a warning when using any of these __constant_ forms:

    __constant_cpu_to_be[x]
    __constant_cpu_to_le[x]
    __constant_be[x]_to_cpu
    __constant_le[x]_to_cpu
    __constant_htons
    __constant_ntohs

    Using any of these outside of include/uapi/ isn't preferred as using the
    function without __constant_ is identical when the argument is a
    constant.

    Signed-off-by: Joe Perches
    Cc: Andy Whitcroft
    Cc: Simon Wunderlich
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • umode_t permissions are sometimes mistakenly written with decimal
    constants. Verify that numeric permissions are using octal.

    Add a list of the most commonly used functions and macros that have
    umode_t permissions and the argument position.

    Add a $Octal type to $Constant.
    Allow $LvalOrFunc to be a pointer indirection too.

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

    Joe Perches
     
  • Checks for some function pointer return styles are too strict. Fix
    them.

    Multiple spaces after function pointer return types are allowed.
    int (*foo)(int bar)

    Spaces after function pointer returns of pointer types are not required.
    int *(*foo)(int bar)

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

    Joe Perches
     
  • Holger reported:

    : The macro udelay cannot handle large values because of loss-of-precision.
    :
    : IMHO udelay on ARM is broken, because it also cannot work with fast
    : ARM processors (where bogomips >= 3355, which is in sight now). It's
    : just not broken enough that someone did something against it ... so
    : the current kludge is good enough.

    Until then, warn on long udelay uses.

    Also fix uses of $line that should have been $herecurr.

    Signed-off-by: Joe Perches
    Reported-by: Holger Schurig
    Cc: Sujith Manoharan
    Cc: John Linville
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Recent increased use of typeof() throughout the tree resulted in a
    number of symbols (25 in a typical distro config of ours) not getting a
    proper CRC calculated for them anymore, due to the parser in genksyms
    not coping with several of these uses (interestingly in the majority of
    [if not all] cases the problem is due to the use of typeof() in code
    preceding a certain export, not in the declaration/definition of the
    exported function/object itself; I wasn't able to find a way to address
    this more general parser shortcoming).

    The use of parameter_declaration is a little more relaxed than would be
    ideal (permitting not just a bare type specification, but also one with
    identifier), but since the same code is being passed through an actual
    compiler, there's no apparent risk of allowing through any broken code.

    Otoh using parameter_declaration instead of the ad hoc
    "decl_specifier_seq '*'" / "decl_specifier_seq" pair allows all types to
    be handled rather than just plain ones and pointers to plain ones.

    Signed-off-by: Jan Beulich
    Cc: Michal Marek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Beulich
     

03 Apr, 2014

1 commit

  • Pull devicetree changes from Grant Likely:
    "Updates to devicetree core code. This branch contains the following
    notable changes:

    - add reserved memory binding
    - make struct device_node a kobject and remove legacy
    /proc/device-tree
    - ePAPR conformance fixes
    - update in-kernel DTC copy to version v1.4.0
    - preparatory changes for dynamic device tree overlays
    - minor bug fixes and documentation changes

    The most significant change in this branch is the conversion of struct
    device_node to be a kobject that is exposed via sysfs and removal of
    the old /proc/device-tree code. This simplifies the device tree
    handling code and tightens up the lifecycle on device tree nodes.

    [updated: added fix for dangling select PROC_DEVICETREE]"

    * tag 'dt-for-linus' of git://git.secretlab.ca/git/linux: (29 commits)
    dt: Remove dangling "select PROC_DEVICETREE"
    of: Add support for ePAPR "stdout-path" property
    of: device_node kobject lifecycle fixes
    of: only scan for reserved mem when fdt present
    powerpc: add support for reserved memory defined by device tree
    arm64: add support for reserved memory defined by device tree
    of: add missing major vendors
    of: add vendor prefix for SMSC
    of: remove /proc/device-tree
    of/selftest: Add self tests for manipulation of properties
    of: Make device nodes kobjects so they show up in sysfs
    arm: add support for reserved memory defined by device tree
    drivers: of: add support for custom reserved memory drivers
    drivers: of: add initialization code for dynamic reserved memory
    drivers: of: add initialization code for static reserved memory
    of: document bindings for reserved-memory nodes
    Revert "of: fix of_update_property()"
    kbuild: dtbs_install: new make target
    ARM: mvebu: Allows to get the SoC ID even without PCI enabled
    of: Allows to use the PCI translator without the PCI core
    ...

    Linus Torvalds
     

02 Apr, 2014

1 commit

  • Pull driver core and sysfs updates from Greg KH:
    "Here's the big driver core / sysfs update for 3.15-rc1.

    Lots of kernfs updates to make it useful for other subsystems, and a
    few other tiny driver core patches.

    All have been in linux-next for a while"

    * tag 'driver-core-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (42 commits)
    Revert "sysfs, driver-core: remove unused {sysfs|device}_schedule_callback_owner()"
    kernfs: cache atomic_write_len in kernfs_open_file
    numa: fix NULL pointer access and memory leak in unregister_one_node()
    Revert "driver core: synchronize device shutdown"
    kernfs: fix off by one error.
    kernfs: remove duplicate dir.c at the top dir
    x86: align x86 arch with generic CPU modalias handling
    cpu: add generic support for CPU feature based module autoloading
    sysfs: create bin_attributes under the requested group
    driver core: unexport static function create_syslog_header
    firmware: use power efficient workqueue for unloading and aborting fw load
    firmware: give a protection when map page failed
    firmware: google memconsole driver fixes
    firmware: fix google/gsmi duplicate efivars_sysfs_init()
    drivers/base: delete non-required instances of include
    kernfs: fix kernfs_node_from_dentry()
    ACPI / platform: drop redundant ACPI_HANDLE check
    kernfs: fix hash calculation in kernfs_rename_ns()
    kernfs: add CONFIG_KERNFS
    sysfs, kobject: add sysfs wrapper for kernfs_enable_ns()
    ...

    Linus Torvalds
     

01 Apr, 2014

1 commit

  • Pull x86 LTO changes from Peter Anvin:
    "More infrastructure work in preparation for link-time optimization
    (LTO). Most of these changes is to make sure symbols accessed from
    assembly code are properly marked as visible so the linker doesn't
    remove them.

    My understanding is that the changes to support LTO are still not
    upstream in binutils, but are on the way there. This patchset should
    conclude the x86-specific changes, and remaining patches to actually
    enable LTO will be fed through the Kbuild tree (other than keeping up
    with changes to the x86 code base, of course), although not
    necessarily in this merge window"

    * 'x86-asmlinkage-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (25 commits)
    Kbuild, lto: Handle basic LTO in modpost
    Kbuild, lto: Disable LTO for asm-offsets.c
    Kbuild, lto: Add a gcc-ld script to let run gcc as ld
    Kbuild, lto: add ld-version and ld-ifversion macros
    Kbuild, lto: Drop .number postfixes in modpost
    Kbuild, lto, workaround: Don't warn for initcall_reference in modpost
    lto: Disable LTO for sys_ni
    lto: Handle LTO common symbols in module loader
    lto, workaround: Add workaround for initcall reordering
    lto: Make asmlinkage __visible
    x86, lto: Disable LTO for the x86 VDSO
    initconst, x86: Fix initconst mistake in ts5500 code
    initconst: Fix initconst mistake in dcdbas
    asmlinkage: Make trace_hardirqs_on/off_caller visible
    asmlinkage, x86: Fix 32bit memcpy for LTO
    asmlinkage Make __stack_chk_failed and memcmp visible
    asmlinkage: Mark rwsem functions that can be called from assembler asmlinkage
    asmlinkage: Make main_extable_sort_needed visible
    asmlinkage, mutex: Mark __visible
    asmlinkage: Make trace_hardirq visible
    ...

    Linus Torvalds
     

31 Mar, 2014

1 commit


30 Mar, 2014

2 commits


17 Mar, 2014

2 commits

  • x86-64 has a problem: per-cpu variables are actually represented by
    their absolute offsets within the per-cpu area, but the symbols are
    not emitted as absolute. Thus kallsyms naively creates them as offsets
    from _text, meaning their values change if the kernel is relocated
    (especially noticeable with CONFIG_RANDOMIZE_BASE):

    $ egrep ' (gdt_|_(stext|_per_cpu_))' /root/kallsyms.nokaslr
    0000000000000000 D __per_cpu_start
    0000000000004000 D gdt_page
    0000000000014280 D __per_cpu_end
    ffffffff810001c8 T _stext
    ffffffff81ee53c0 D __per_cpu_offset
    $ egrep ' (gdt_|_(stext|_per_cpu_))' /root/kallsyms.kaslr1
    000000001f200000 D __per_cpu_start
    000000001f204000 D gdt_page
    000000001f214280 D __per_cpu_end
    ffffffffa02001c8 T _stext
    ffffffffa10e53c0 D __per_cpu_offset

    Making them absolute symbols is the Right Thing, but requires fixes to
    the relocs tool. So for the moment, we add a --absolute-percpu option
    which makes them absolute from a kallsyms perspective:

    $ egrep ' (gdt_|_(stext|_per_cpu_))' /proc/kallsyms # no KASLR
    0000000000000000 A __per_cpu_start
    000000000000a000 A gdt_page
    0000000000013040 A __per_cpu_end
    ffffffff802001c8 T _stext
    ffffffff8099b180 D __per_cpu_offset
    ffffffff809a3000 D __per_cpu_load
    $ egrep ' (gdt_|_(stext|_per_cpu_))' /proc/kallsyms # With KASLR
    0000000000000000 A __per_cpu_start
    000000000000a000 A gdt_page
    0000000000013040 A __per_cpu_end
    ffffffff89c001c8 T _stext
    ffffffff8a39d180 D __per_cpu_offset
    ffffffff8a3a5000 D __per_cpu_load

    Based-on-the-original-screenplay-by: Andy Honig
    Signed-off-by: Rusty Russell
    Acked-by: Kees Cook

    Rusty Russell
     
  • This refactors the address range checks to be generalized instead of
    specific to text range checks, in preparation for other range checks.
    Also extracts logic for "is the symbol absolute" into a function.

    Signed-off-by: Kees Cook
    Signed-off-by: Rusty Russell

    Kees Cook