-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/…
…mmarek/kbuild Pull kbuild misc updates from Michal Marek: - one new coccinelle check and improvements to irqf_oneshot.cocci - 'make rpm' POSIX compatibility fix - 'make deb-pkg' arm64 cross-compiling fix. I forgot to send this one during the v4.9 rc-phase, therefor the pull request is based on -rc6 and not -rc1 * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: Coccinelle: misc: Add support for devm variant in all modes Coccinelle: misc: Improve the result given by context mode Coccinelle: misc: Improve the matching of rules kbuild/mkspec: avoid using brace expansion Coccinelle: Add misc/boolconv.cocci builddeb: fix cross-building to arm64 producing host-arch debs
- Loading branch information
Showing
4 changed files
with
129 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/// Remove unneeded conversion to bool | ||
/// | ||
//# Relational and logical operators evaluate to bool, | ||
//# explicit conversion is overly verbose and unneeded. | ||
// | ||
// Copyright: (C) 2016 Andrew F. Davis <afd@ti.com> GPLv2. | ||
|
||
virtual patch | ||
virtual context | ||
virtual org | ||
virtual report | ||
|
||
//---------------------------------------------------------- | ||
// For patch mode | ||
//---------------------------------------------------------- | ||
|
||
@depends on patch@ | ||
expression A, B; | ||
symbol true, false; | ||
@@ | ||
|
||
( | ||
A == B | ||
| | ||
A != B | ||
| | ||
A > B | ||
| | ||
A < B | ||
| | ||
A >= B | ||
| | ||
A <= B | ||
| | ||
A && B | ||
| | ||
A || B | ||
) | ||
- ? true : false | ||
|
||
//---------------------------------------------------------- | ||
// For context mode | ||
//---------------------------------------------------------- | ||
|
||
@r depends on !patch@ | ||
expression A, B; | ||
symbol true, false; | ||
position p; | ||
@@ | ||
|
||
( | ||
A == B | ||
| | ||
A != B | ||
| | ||
A > B | ||
| | ||
A < B | ||
| | ||
A >= B | ||
| | ||
A <= B | ||
| | ||
A && B | ||
| | ||
A || B | ||
) | ||
* ? true : false@p | ||
|
||
//---------------------------------------------------------- | ||
// For org mode | ||
//---------------------------------------------------------- | ||
|
||
@script:python depends on r&&org@ | ||
p << r.p; | ||
@@ | ||
msg = "WARNING: conversion to bool not needed here" | ||
coccilib.org.print_todo(p[0], msg) | ||
//---------------------------------------------------------- | ||
// For report mode | ||
//---------------------------------------------------------- | ||
@script:python depends on r&&report@ | ||
p << r.p; | ||
@@ | ||
msg = "WARNING: conversion to bool not needed here" | ||
coccilib.report.print_report(p[0], msg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters