28 Jan, 2015

1 commit

  • commit 7426977c8efeaedf0a7ca00e1c1a5f52ef6b950f upstream.

    The comma after --no-includes makes coccinelle to not run the script:

    /usr/bin/spatch -D report --very-quiet --no-show-diff --cocci-file ./scripts/coccinelle/misc/bugon.cocci --no-includes, --include-headers --patch . --dir drivers/media/platform/coda/ -I ./arch/x86/include -I arch/x86/include/generated -I include -I ./arch/x86/include/uapi -I arch/x86/include/generated/uapi -I ./include/uapi -I include/generated/uapi -I ./include/linux/kconfig.h
    Usage: spatch.opt --sp-file [-o ] [--iso-file ] [options]
    Options are:
    --sp-file the semantic patch file
    -o the output file
    --in-place do the modification on the file directly
    --backup-suffix suffix to use when making a backup for inplace
    ...

    At least with Fedora 20 coccinelle package:
    coccinelle-1.0.0-0.rc20.1.fc21.x86_64

    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Julia Lawall
    Tested-by: Wolfram Sang
    Fixes: 5be1df66 (Coccinelle: Script to replace if and BUG with BUG_ON)
    Signed-off-by: Michal Marek
    Signed-off-by: Greg Kroah-Hartman

    Mauro Carvalho Chehab
     

26 Sep, 2014

1 commit


15 Aug, 2014

1 commit

  • Pull misc kbuild updates from Michal Marek:
    "This is the non-critical part of kbuild for 3.17-rc1:

    - make help hint to use make -s with make kernelrelease et al.
    - moved a kbuild document to Documentation/kbuild where it belongs
    - four new Coccinelle scripts, one dropped and one fixed
    - new make kselftest target to run various tests on the kernel"

    * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    kbuild: kselftest - new make target to build and run kernel selftests
    Coccinelle: Script to replace if and BUG with BUG_ON
    Coccinelle: Script to detect incorrect argument to sizeof
    Coccinelle: Script to use ARRAY_SIZE instead of division of two sizeofs
    Coccinelle: Script to detect cast after memory allocation
    coccinelle/null: solve parse error
    Documentation: headers_install.txt is part of kbuild
    kbuild: make -s should be used with kernelrelease/kernelversion/image_name

    Linus Torvalds
     

09 Aug, 2014

2 commits


06 Aug, 2014

5 commits

  • This script detects cases where BUG() follows an if condition on an
    expression and replaces the if condition and BUG() with a BUG_ON having
    the conditional expression of the if statement as argument.

    Signed-off-by: Himangi Saraogi
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Himangi Saraogi
     
  • This makes an effort to find cases where the argument to sizeof is wrong
    in memory allocation functions by checking the type of the allocated
    memory when it is a double pointer and ensuring the sizeof argument takes
    a pointer to the the memory being allocated. There are false positives
    in cases the sizeof argument is not used in constructing the return value.

    Signed-off-by: Himangi Saraogi
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Himangi Saraogi
     
  • This script detects cases where ARRAY_SIZE can be used such as
    where there is a division of sizeof the array by the sizeof its first
    element or by any indexed element or the element type. It replaces the
    division of the two sizeofs by ARRAY_SIZE.

    Signed-off-by: Himangi Saraogi
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Himangi Saraogi
     
  • This script detects cases of use of cast for the value returned by
    kmalloc, kzalloc, kcalloc, kmem_cache_alloc, kmem_cache_zalloc,
    kmem_cache_alloc_node, kmalloc_node and kzalloc_node and removes
    the cast as it is not useful. This Coccinelle script replaces
    drop_kmalloc_cast.cocci as it removes the casting in more limited
    cases of kmalloc, kzalloc and kcalloc.

    Signed-off-by: Himangi Saraogi
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Himangi Saraogi
     
  • This patch solves the parse-error by adding @@ . This is necessary since
    Coccinelle version 1.0.0-rc20. Also, the comment is added to use a
    recent version of Coccinelle.

    Signed-off-by: Himangi Saraogi
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Himangi Saraogi
     

20 Jun, 2014

1 commit

  • devm_request_and_ioremap() was obsoleted by the commit 7509657
    ("lib: devres: Introduce devm_ioremap_resource()") and has been
    deprecated for a long time. So, let's remove this function.
    In addition, all usages of devm_request_and_ioremap() are also
    removed.

    Signed-off-by: Jingoo Han
    Signed-off-by: Greg Kroah-Hartman

    Jingoo Han
     

10 Jun, 2014

2 commits

  • This semantic patch looks for variables that are initialized with a
    constant, are never updated, and are only used as parameter of return.
    Return the constant instead of using a variable.

    Signed-off-by: Peter Senna Tschudin
    Signed-off-by: Michal Marek

    Peter Senna Tschudin
     
  • Failure to terminate an of_device_id table can lead to confusing
    failures depending on where the compiler places the array. Add a
    check to make sure these tables are terminated. Thanks to Mitchel
    Humpherys for coming up with the pattern initially.

    Cc: Mitchel Humpherys
    Cc: Gilles Muller
    Cc: Nicolas Palix
    Cc: Rob Herring
    Cc: devicetree@vger.kernel.org
    Signed-off-by: Stephen Boyd
    Acked-by: Grant Likely
    Signed-off-by: Julia Lawall
    Signed-off-by: Michal Marek

    Stephen Boyd
     

08 Apr, 2014

1 commit


30 Mar, 2014

1 commit

  • The Coccinelle script scripts/coccinelle/misc/memcpy-assign.cocci look
    for opportunities to replace a call to memcpy by a struct assignment.
    This patch removes memcpy-assign.cocci as it is not clear that this
    convention has an impact on the generated code.

    Signed-off-by: Peter Senna Tschudin
    Signed-off-by: Michal Marek

    Peter Senna Tschudin
     

03 Jan, 2014

1 commit

  • As indicated by Sekhar in [1], there seems to be a tendency to use
    IS_ERR_VALUE to check the error result for pm_runtime_* functions which
    make no sense considering commit c48cd65 (ARM: OMAP: use consistent
    error checking) - the error values can either be < 0 for error OR
    0, 1 in cases where we have success.

    So, setup a coccinelle script to help identify the same.

    [1] http://marc.info/?t=138472678100003&r=1&w=2

    Cc: Russell King
    Reported-by: Sekhar Nori
    Signed-off-by: Nishanth Menon
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Nishanth Menon
     

23 Oct, 2013

1 commit


08 Sep, 2013

1 commit

  • Pull misc kbuild updates from Michal Marek:
    "In the kbuild misc branch, I have:
    - make rpm-pkg updates, most importantly the rpm package now calls
    /sbin/installkernel
    - make deb-pkg: debuginfo split, correct kernel image path for
    parisc, mips and powerpc and a couple more minor fixes
    - New coccinelle check"

    * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    scripts/checkkconfigsymbols.sh: replace echo -e with printf
    Provide version number for Debian firmware package
    coccinelle: replace 0/1 with false/true in functions returning bool
    deb-pkg: add a hook argument to match debian hooks parameters
    deb-pkg: fix installed image path on parisc, mips and powerpc
    deb-pkg: split debug symbols in their own package
    deb-pkg: use KCONFIG_CONFIG instead of .config file directly
    rpm-pkg: add generation of kernel-devel
    rpm-pkg: install firmware files in kernel relative directory
    rpm-pkg: add %post section to create initramfs and grub hooks

    Linus Torvalds
     

14 Aug, 2013

1 commit


15 Jul, 2013

1 commit


04 Jul, 2013

1 commit


03 Jul, 2013

1 commit


14 Jun, 2013

1 commit


28 Feb, 2013

1 commit

  • Pull misc non-critical kbuild changes from Michal Marek:

    - Fix for make TAGS

    - Fix for make rpm

    - Some new coccinelle semantic patches

    * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    scripts/coccinelle: find constant additions that could be bit ors
    coccicheck: Allow to show the executed command line
    coccicheck: Allow the user to give a V= (verbose) argument
    scripts/coccinelle/misc/memcpy-assign.cocci: Replace memcpy with struct assignment
    kbuild: clear KBUILD_SRC when calling 'make' in RPM spec
    scripts/coccinelle/misc/semicolon.cocci: Add unneeded semicolon test
    scripts/tags.sh: Fix regex syntax for etags

    Linus Torvalds
     

22 Feb, 2013

2 commits


24 Jan, 2013

1 commit

  • This semantic patch looks for semicolons that can be removed without
    changing the semantics of the code. The confidence is moderate
    because there are some false positives on cases like:

    b/drivers/mmc/host/cb710-mmc.c:589
    break;
    case MMC_POWER_UP:
    default:
    - /* ignore */;
    }

    There are 37 patches accepted reported by this semantic patch and
    more than 300 fixes to be applied.

    Signed-off-by: Peter Senna Tschudin
    Signed-off-by: Michal Marek

    Peter Senna Tschudin
     

23 Jan, 2013

1 commit

  • The devm_request_and_ioremap() function is very useful and helps avoid a
    whole lot of boilerplate. However, one issue that keeps popping up is
    its lack of a specific error code to determine which of the steps that
    it performs failed. Furthermore, while the function gives an example and
    suggests what error code to return on failure, a wide variety of error
    codes are used throughout the tree.

    In an attempt to fix these problems, this patch adds a new function that
    drivers can transition to. The devm_ioremap_resource() returns a pointer
    to the remapped I/O memory on success or an ERR_PTR() encoded error code
    on failure. Callers can check for failure using IS_ERR() and determine
    its cause by extracting the error code using PTR_ERR().

    devm_request_and_ioremap() is implemented as a wrapper around the new
    API and return NULL on failure as before. This ensures that backwards
    compatibility is maintained until all users have been converted to the
    new API, at which point the old devm_request_and_ioremap() function
    should be removed.

    A semantic patch is included which can be used to convert from the old
    devm_request_and_ioremap() API to the new devm_ioremap_resource() API.
    Some non-trivial cases may require manual intervention, though.

    Signed-off-by: Thierry Reding
    Cc: Arnd Bergmann
    Acked-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Thierry Reding
     

21 Dec, 2012

1 commit

  • Pull kbuild misc changes from Michal Marek:
    "This is the non-critical part of kbuild

    - scripts/kernel-doc requires a "Return:" section for non-void
    functions
    - ARCH=arm SUBARCH=... support for make tags
    - COMPILED_SOURCE=1 support for make tags (only indexes .c files for
    which a .o exists)
    - New coccinelle check
    - Option parsing fix for scripts/config"

    * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    scripts/config: Fix wrong "shift" for --keep-case
    scripts/tags.sh: Support compiled source
    scripts/tags.sh: Support subarch for ARM
    scripts/coccinelle/misc/warn.cocci: use WARN
    scripts/kernel-doc: check that non-void fcts describe their return value
    Kernel-doc: Convention: Use a "Return" section to describe return values

    Linus Torvalds
     

19 Dec, 2012

1 commit


09 Dec, 2012

1 commit


12 Oct, 2012

1 commit

  • Pull kbuild misc changes from Michal Marek:
    "In the non-critical part of kbuild, I have
    - Some make coccicheck improvements and two new tests
    - Support for a cleaner html output in scripts/kernel-doc, named
    html5 (no, it does not play videos, yet)

    BTW, Randy wants to route further kernel-doc patches through the
    kbuild tree."

    * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    Update SmPL/Coccinelle section of MAINTAINERS
    coccicheck: Add the rep+ctxt mode
    scripts/coccinelle/tests/odd_ptr_err.cocci: semantic patch for IS_ERR/PTR_ERR inconsistency
    scripts/tags.sh: Add magic for pci access functions
    scripts/coccinelle: ptr_ret: Add ternary operator version
    scripts/kernel-doc: drop maintainer
    scripts/kernel-doc: added support for html5

    Linus Torvalds
     

11 Oct, 2012

1 commit


02 Oct, 2012

1 commit

  • Pull the trivial tree from Jiri Kosina:
    "Tiny usual fixes all over the place"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (34 commits)
    doc: fix old config name of kprobetrace
    fs/fs-writeback.c: cleanup riteback_sb_inodes kerneldoc
    btrfs: fix the commment for the action flags in delayed-ref.h
    btrfs: fix trivial typo for the comment of BTRFS_FREE_INO_OBJECTID
    vfs: fix kerneldoc for generic_fh_to_parent()
    treewide: fix comment/printk/variable typos
    ipr: fix small coding style issues
    doc: fix broken utf8 encoding
    nfs: comment fix
    platform/x86: fix asus_laptop.wled_type module parameter
    mfd: printk/comment fixes
    doc: getdelays.c: remember to close() socket on error in create_nl_socket()
    doc: aliasing-test: close fd on write error
    mmc: fix comment typos
    dma: fix comments
    spi: fix comment/printk typos in spi
    Coccinelle: fix typo in memdup_user.cocci
    tmiofb: missing NULL pointer checks
    tools: perf: Fix typo in tools/perf
    tools/testing: fix comment / output typos
    ...

    Linus Torvalds
     

01 Sep, 2012

1 commit


31 Aug, 2012

1 commit


14 Jul, 2012

1 commit


13 Jul, 2012

1 commit


29 May, 2012

1 commit

  • Pull misc kbuild changes from Michal Marek:
    "The non-critical part of kbuild for 3.5 includes

    - two new coccinelle checks
    - fix for make deb-pkg to include generated headers in arch/*/include

    I have more make-deb-pkg fixes in the backlog, but these will likely
    have to wait for 3.6."

    * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    builddeb: include autogenerated header files
    scripts/coccinelle: sizeof of pointer
    scripts/coccinelle: address test is always true

    Linus Torvalds
     

25 May, 2012

1 commit