Merge tag 'coccinelle-for-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux

Pull coccinelle semantic patch updates from Julia Lawall:

 - Update the semantic patches in the kernel that contain a URL for
   Coccinelle with a URL that is currently valid (from myself).

 - Add a semantic patch checking for unnecessary NULL tests on dev_{put,
   hold} functions (from Ziyang Xuan, followed bt a modification from
   myself).

 - Drop a semantic patch that replaces 0/1 by booleans, as this change
   was considered to be not worthwhile by some maintainers (from Steve
   Rostedt).

 - Extend an existing semantic patch with more checks for useless tests
   on variables addresses (from Jérémy Lefaure).

* tag 'coccinelle-for-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux:
  update Coccinelle URL
  coccinelle: free: add version constraint
  scripts/coccinelle/free: add NULL test before dev_{put, hold} functions
  coccinelle: Remove script that checks replacing 0/1 with false/true in functions returning bool
  coccinelle: Extend address test from ifaddr semantic patch to test expressions
This commit is contained in:
Linus Torvalds
2022-08-08 09:42:04 -07:00
45 changed files with 99 additions and 105 deletions

View File

@@ -10,7 +10,7 @@
// Copyright: (C) 2009-2010 Julia Lawall, Nicolas Palix, DIKU.
// Copyright: (C) 2009-2010 Gilles Muller, INRIA/LiP6.
// Copyright: (C) 2017 Himanshu Jha
// URL: http://coccinelle.lip6.fr/rules/kzalloc.html
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Options: --no-includes --include-headers
//
// Keywords: kmalloc, kzalloc

View File

@@ -5,7 +5,7 @@
// Copyright (c) 2016-2017, Elena Reshetova, Intel Corporation
//
// Confidence: Moderate
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Options: --include-headers --very-quiet
virtual report

View File

@@ -6,7 +6,7 @@
///
// Confidence: High
// Copyright: (C) 2017 Julia Lawall, Inria/LIP6,
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Requires: 1.0.7
// Keywords: BQ27XXX_DATA

View File

@@ -4,7 +4,7 @@
// Keywords: d_find_alias, dput
//
// Confidence: Moderate
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Options: --include-headers
virtual context

View File

@@ -6,7 +6,7 @@
// Copyright: (C) 2009, 2010 Nicolas Palix, DIKU.
// Copyright: (C) 2009, 2010 Julia Lawall, DIKU.
// Copyright: (C) 2009, 2010 Gilles Muller, INRIA/LiP6.
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Options:
//
// Keywords: ERR_PTR, PTR_ERR, ERR_CAST

View File

@@ -5,7 +5,7 @@
// Copyright: (C) 2010-2012 Nicolas Palix.
// Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6.
// Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6.
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Comments:
// Options: --no-includes --include-headers

View File

@@ -5,7 +5,7 @@
// Copyright: (C) 2010-2012 Nicolas Palix.
// Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6.
// Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6.
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Comments:
// Options: --no-includes --include-headers

View File

@@ -6,7 +6,7 @@
// Copyright: (C) 2010-2012 Nicolas Palix.
// Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6.
// Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6.
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Comments:
// Options: --no-includes --include-headers

View File

@@ -4,7 +4,7 @@
// Keywords: pm_runtime
// Confidence: Medium
// Copyright (C) 2013 Texas Instruments Incorporated -
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Options: --include-headers
virtual patch

View File

@@ -7,7 +7,7 @@
// Copyright: (C) 2009, 2010 Nicolas Palix, DIKU.
// Copyright: (C) 2009, 2010 Julia Lawall, DIKU.
// Copyright: (C) 2009, 2010 Gilles Muller, INRIA/LiP6.
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Options:
//
// Keywords: resource_size

View File

@@ -8,7 +8,7 @@
// Confidence: Moderate
// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6.
// Copyright: (C) 2012 Gilles Muller, INRIA/LiP6.
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Comments:
// Options:

View File

@@ -17,7 +17,7 @@
// Confidence: Moderate
// Copyright: (C) 2011 Julia Lawall, INRIA/LIP6.
// Copyright: (C) 2011 Gilles Muller, INRIA/LiP6.
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Comments:
// Options: --no-includes --include-headers

View File

@@ -0,0 +1,55 @@
// SPDX-License-Identifier: GPL-2.0-only
/// Since commit b37a46683739 ("netdevice: add the case if dev is NULL"),
/// NULL check before dev_{put, hold} functions is not needed.
///
/// Based on ifnullfree.cocci by Fabian Frederick.
///
// Copyright: (C) 2022 Ziyang Xuan.
// Comments: -
// Options: --no-includes --include-headers
// Version min: 5.15
virtual patch
virtual org
virtual report
virtual context
@r2 depends on patch@
expression E;
@@
- if (E != NULL)
(
__dev_put(E);
|
dev_put(E);
|
dev_put_track(E, ...);
|
__dev_hold(E);
|
dev_hold(E);
|
dev_hold_track(E, ...);
)
@r depends on context || report || org @
expression E;
position p;
@@
* if (E != NULL)
* \(__dev_put@p\|dev_put@p\|dev_put_track@p\|__dev_hold@p\|dev_hold@p\|
* dev_hold_track@p\)(E, ...);
@script:python depends on org@
p << r.p;
@@
cocci.print_main("NULL check before dev_{put, hold} functions is not needed", p)
@script:python depends on report@
p << r.p;
@@
msg = "WARNING: NULL check before dev_{put, hold} functions is not needed."
coccilib.report.print_report(p[0], msg)

View File

@@ -8,7 +8,7 @@
// Confidence: Moderate
// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6.
// Copyright: (C) 2012 Gilles Muller, INRIA/LiP6.
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Comments:
// Options:

View File

@@ -9,7 +9,7 @@
// Copyright: (C) 2010-2012 Nicolas Palix.
// Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6.
// Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6.
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Comments:
// Options: --no-includes --include-headers

View File

@@ -3,7 +3,7 @@
///
// Confidence: High
// Copyright: (C) 2013 Julia Lawall, INRIA/LIP6.
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Comments:
// Options: --no-includes --include-headers

View File

@@ -3,7 +3,7 @@
///
// Confidence: Moderate
// Copyright: (C) 2013 Petr Strnad.
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Keywords: pci_free_consistent, pci_alloc_consistent
// Options: --no-includes --include-headers

View File

@@ -4,7 +4,7 @@
///
// Confidence: High
// Copyright: (C) 2015 Julia Lawall, Inria.
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Options: --no-includes --include-headers
// Requires: 1.0.4
// Keywords: for_each_child_of_node, etc.

View File

@@ -5,7 +5,7 @@
///
// Confidence: High
// Copyright: (C) 2020 Sumera Priyadarsini
// URL: http://coccinelle.lip6.fr
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Options: --no-includes --include-headers
virtual patch

View File

@@ -10,7 +10,7 @@
// Copyright: (C) 2010-2012 Nicolas Palix.
// Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6.
// Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6.
// URL: http://coccinelle.lip6.fr/
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Comments:
// Options: --no-includes --include-headers

Some files were not shown because too many files have changed in this diff Show More