~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/scripts/coccinelle/iterators/device_node_continue.cocci

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /scripts/coccinelle/iterators/device_node_continue.cocci (Architecture i386) and /scripts/coccinelle/iterators/device_node_continue.cocci (Architecture alpha)


  1 // SPDX-License-Identifier: GPL-2.0-only            1 // SPDX-License-Identifier: GPL-2.0-only
  2 /// Device node iterators put the previous val      2 /// Device node iterators put the previous value of the index variable, so an
  3 /// explicit put causes a double put.               3 /// explicit put causes a double put.
  4 ///                                                 4 ///
  5 // Confidence: High                                 5 // Confidence: High
  6 // Copyright: (C) 2015 Julia Lawall, Inria.         6 // Copyright: (C) 2015 Julia Lawall, Inria.
  7 // URL: https://coccinelle.gitlabpages.inria.f      7 // URL: https://coccinelle.gitlabpages.inria.fr/website
  8 // Options: --no-includes --include-headers         8 // Options: --no-includes --include-headers
  9 // Requires: 1.0.4                                  9 // Requires: 1.0.4
 10 // Keywords: for_each_child_of_node, etc.          10 // Keywords: for_each_child_of_node, etc.
 11                                                    11 
 12 // This uses a conjunction, which requires at      12 // This uses a conjunction, which requires at least coccinelle >= 1.0.4
 13                                                    13 
 14 virtual patch                                      14 virtual patch
 15 virtual context                                    15 virtual context
 16 virtual org                                        16 virtual org
 17 virtual report                                     17 virtual report
 18                                                    18 
 19 @r exists@                                         19 @r exists@
 20 expression e1,e2;                                  20 expression e1,e2;
 21 local idexpression n;                              21 local idexpression n;
 22 iterator name for_each_node_by_name, for_each_     22 iterator name for_each_node_by_name, for_each_node_by_type,
 23 for_each_compatible_node, for_each_matching_no     23 for_each_compatible_node, for_each_matching_node,
 24 for_each_matching_node_and_match, for_each_chi     24 for_each_matching_node_and_match, for_each_child_of_node,
 25 for_each_available_child_of_node, for_each_nod     25 for_each_available_child_of_node, for_each_node_with_property;
 26 iterator i;                                        26 iterator i;
 27 position p1,p2;                                    27 position p1,p2;
 28 statement S;                                       28 statement S;
 29 @@                                                 29 @@
 30                                                    30 
 31 (                                                  31 (
 32 (                                                  32 (
 33 for_each_node_by_name(n,e1) S                      33 for_each_node_by_name(n,e1) S
 34 |                                                  34 |
 35 for_each_node_by_type(n,e1) S                      35 for_each_node_by_type(n,e1) S
 36 |                                                  36 |
 37 for_each_compatible_node(n,e1,e2) S                37 for_each_compatible_node(n,e1,e2) S
 38 |                                                  38 |
 39 for_each_matching_node(n,e1) S                     39 for_each_matching_node(n,e1) S
 40 |                                                  40 |
 41 for_each_matching_node_and_match(n,e1,e2) S        41 for_each_matching_node_and_match(n,e1,e2) S
 42 |                                                  42 |
 43 for_each_child_of_node(e1,n) S                     43 for_each_child_of_node(e1,n) S
 44 |                                                  44 |
 45 for_each_available_child_of_node(e1,n) S           45 for_each_available_child_of_node(e1,n) S
 46 |                                                  46 |
 47 for_each_node_with_property(n,e1) S                47 for_each_node_with_property(n,e1) S
 48 )                                                  48 )
 49 &                                                  49 &
 50 i@p1(...) {                                        50 i@p1(...) {
 51    ... when != of_node_get(n)                      51    ... when != of_node_get(n)
 52        when any                                    52        when any
 53    of_node_put@p2(n);                              53    of_node_put@p2(n);
 54    ... when any                                    54    ... when any
 55 }                                                  55 }
 56 )                                                  56 )
 57                                                    57 
 58 @s exists@                                         58 @s exists@
 59 local idexpression r.n;                            59 local idexpression r.n;
 60 statement S;                                       60 statement S;
 61 position r.p1,r.p2;                                61 position r.p1,r.p2;
 62 iterator i;                                        62 iterator i;
 63 @@                                                 63 @@
 64                                                    64 
 65  of_node_put@p2(n);                                65  of_node_put@p2(n);
 66  ... when any                                      66  ... when any
 67  i@p1(..., n, ...)                                 67  i@p1(..., n, ...)
 68  S                                                 68  S
 69                                                    69 
 70 @t depends on s && patch && !context && !org &     70 @t depends on s && patch && !context && !org && !report@
 71 local idexpression n;                              71 local idexpression n;
 72 position r.p2;                                     72 position r.p2;
 73 @@                                                 73 @@
 74                                                    74 
 75 - of_node_put@p2(n);                               75 - of_node_put@p2(n);
 76                                                    76 
 77 // -------------------------------------------     77 // ----------------------------------------------------------------------------
 78                                                    78 
 79 @t_context depends on s && !patch && (context      79 @t_context depends on s && !patch && (context || org || report)@
 80 local idexpression n;                              80 local idexpression n;
 81 position r.p2;                                     81 position r.p2;
 82 position j0;                                       82 position j0;
 83 @@                                                 83 @@
 84                                                    84 
 85 *  of_node_put@j0@p2(n);                           85 *  of_node_put@j0@p2(n);
 86                                                    86 
 87 // -------------------------------------------     87 // ----------------------------------------------------------------------------
 88                                                    88 
 89 @script:python t_org depends on org@               89 @script:python t_org depends on org@
 90 j0 << t_context.j0;                                90 j0 << t_context.j0;
 91 @@                                                 91 @@
 92                                                    92 
 93 msg = "ERROR: probable double put."                93 msg = "ERROR: probable double put."
 94 coccilib.org.print_todo(j0[0], msg)                94 coccilib.org.print_todo(j0[0], msg)
 95                                                    95 
 96 // -------------------------------------------     96 // ----------------------------------------------------------------------------
 97                                                    97 
 98 @script:python t_report depends on report@         98 @script:python t_report depends on report@
 99 j0 << t_context.j0;                                99 j0 << t_context.j0;
100 @@                                                100 @@
101                                                   101 
102 msg = "ERROR: probable double put."               102 msg = "ERROR: probable double put."
103 coccilib.report.print_report(j0[0], msg)          103 coccilib.report.print_report(j0[0], msg)
104                                                   104 
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php