13 Jan, 2016

1 commit

  • Unsigned expressions cannot be lesser than zero. Presence of comparisons
    'unsigned (|>=) 0' often indicates a bug, usually wrong type of variable.
    The patch beside finding such comparisons tries to eliminate false positives,
    mainly by bypassing range checks.

    gcc can detect such comparisons also using -Wtype-limits switch, but it warns
    also in correct cases, making too much noise.

    Signed-off-by: Andrzej Hajda
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Andrzej Hajda
     

27 Oct, 2015

8 commits


09 Sep, 2015

2 commits

  • Merge second patch-bomb from Andrew Morton:
    "Almost all of the rest of MM. There was an unusually large amount of
    MM material this time"

    * emailed patches from Andrew Morton : (141 commits)
    zpool: remove no-op module init/exit
    mm: zbud: constify the zbud_ops
    mm: zpool: constify the zpool_ops
    mm: swap: zswap: maybe_preload & refactoring
    zram: unify error reporting
    zsmalloc: remove null check from destroy_handle_cache()
    zsmalloc: do not take class lock in zs_shrinker_count()
    zsmalloc: use class->pages_per_zspage
    zsmalloc: consider ZS_ALMOST_FULL as migrate source
    zsmalloc: partial page ordering within a fullness_list
    zsmalloc: use shrinker to trigger auto-compaction
    zsmalloc: account the number of compacted pages
    zsmalloc/zram: introduce zs_pool_stats api
    zsmalloc: cosmetic compaction code adjustments
    zsmalloc: introduce zs_can_compact() function
    zsmalloc: always keep per-class stats
    zsmalloc: drop unused variable `nr_to_migrate'
    mm/memblock.c: fix comment in __next_mem_range()
    mm/page_alloc.c: fix type information of memoryless node
    memory-hotplug: fix comments in zone_spanned_pages_in_node() and zone_spanned_pages_in_node()
    ...

    Linus Torvalds
     
  • add [pci|dma]_pool_zalloc coccinelle check.
    replaces instances of [pci|dma]_pool_alloc() followed by memset(0)
    with [pci|dma]_pool_zalloc().

    Signed-off-by: Sean O. Stalley
    Acked-by: Julia Lawall
    Cc: Vinod Koul
    Cc: Bjorn Helgaas
    Cc: Gilles Muller
    Cc: Nicolas Palix
    Cc: Michal Marek
    Cc: Sebastian Andrzej Siewior
    Cc: Jonathan Corbet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sean O. Stalley
     

19 Aug, 2015

1 commit


03 Jun, 2015

1 commit


25 May, 2015

1 commit


21 May, 2015

3 commits


20 May, 2015

4 commits

  • According to Documentation/SubmittingPatches:

    "Describe your changes in imperative mood, e.g. "make xyzzy do frotz"
    instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy
    to do frotz", as if you are giving orders to the codebase to change
    its behaviour."

    So do as recommended.

    Signed-off-by: Fabio Estevam
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Fabio Estevam
     
  • Make the sentence sensible.

    Signed-off-by: Fabio Estevam
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Fabio Estevam
     
  • According to Documentation/SubmittingPatches:

    "Describe your changes in imperative mood, e.g. "make xyzzy do frotz"
    instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy
    to do frotz", as if you are giving orders to the codebase to change
    its behaviour."

    So do as recommended.

    Signed-off-by: Fabio Estevam
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Fabio Estevam
     
  • Insert a blank line in order to improve the readability of the
    generated patch and also make it consistent with the other
    .cocci files.

    Signed-off-by: Fabio Estevam
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Fabio Estevam
     

15 Apr, 2015

1 commit


25 Mar, 2015

1 commit

  • Since commit 1c6c69525b40eb76de8adf039409722015927dc3 ("genirq: Reject
    bogus threaded irq requests") threaded IRQs without a primary handler
    need to be requested with IRQF_ONESHOT, otherwise the request will fail.

    Until now, this coccinelle script only checked request_threaded_irq().
    However, the counterpart devm function (see kernel/irq/devres.c) is also
    affected by the missing flag which can be detected with this patch.

    Signed-off-by: Valentin Rothberg
    Signed-off-by: Peter Senna Tschudin
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Valentin Rothberg
     

21 Dec, 2014

1 commit


25 Nov, 2014

1 commit

  • 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)
    Cc: stable@vger.kernel.org
    Signed-off-by: Michal Marek

    Mauro Carvalho Chehab
     

07 Nov, 2014

1 commit

  • There are calls which silently set the owner of a module. This is the
    preferred way [1], so avoid setting it manually. Currently, we only care
    about platform drivers, but there might be more calls to be added later.

    [1] https://lkml.org/lkml/2014/10/12/87

    Signed-off-by: Wolfram Sang
    Signed-off-by: Greg Kroah-Hartman

    Wolfram Sang
     

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