Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /// Find confusingly indented code in or after an if.  An if branch should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) /// be indented.  The code following an if should not be indented.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) /// Sometimes, code after an if that is indented is actually intended to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) /// part of the if branch.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) ///
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) //# This has a high rate of false positives, because Coccinelle's column
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) //# calculation does not distinguish between spaces and tabs, so code that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) //# is not visually aligned may be considered to be in the same column.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) //
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) // Confidence: Low
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) // Copyright: (C) 2010 Nicolas Palix, DIKU.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) // Copyright: (C) 2010 Julia Lawall, DIKU.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) // Copyright: (C) 2010 Gilles Muller, INRIA/LiP6.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) // URL: http://coccinelle.lip6.fr/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) // Comments:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) // Options: --no-includes --include-headers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) virtual org
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) virtual report
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) @r disable braces4@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) position p1,p2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) statement S1,S2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) (
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) if (...) { ... }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) if (...) S1@p1 S2@p2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) @script:python depends on org@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) p1 << r.p1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) p2 << r.p2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) if (p1[0].column == p2[0].column):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)   cocci.print_main("branch",p1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)   cocci.print_secs("after",p2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) @script:python depends on report@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) p1 << r.p1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) p2 << r.p2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) if (p1[0].column == p2[0].column):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)   msg = "code aligned with following code on line %s" % (p2[0].line)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)   coccilib.report.print_report(p1[0],msg)