-
Notifications
You must be signed in to change notification settings - Fork 0
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 misc kbuild updates from Michal Marek: "In the kbuild misc branch, I have: - make rpm-pkg updates, most importantly the rpm package now calls /sbin/installkernel - make deb-pkg: debuginfo split, correct kernel image path for parisc, mips and powerpc and a couple more minor fixes - New coccinelle check" * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: scripts/checkkconfigsymbols.sh: replace echo -e with printf Provide version number for Debian firmware package coccinelle: replace 0/1 with false/true in functions returning bool deb-pkg: add a hook argument to match debian hooks parameters deb-pkg: fix installed image path on parisc, mips and powerpc deb-pkg: split debug symbols in their own package deb-pkg: use KCONFIG_CONFIG instead of .config file directly rpm-pkg: add generation of kernel-devel rpm-pkg: install firmware files in kernel relative directory rpm-pkg: add %post section to create initramfs and grub hooks
- Loading branch information
Showing
4 changed files
with
178 additions
and
24 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
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,58 @@ | ||
/// Return statements in functions returning bool should use | ||
/// true/false instead of 1/0. | ||
// | ||
// Confidence: High | ||
// Options: --no-includes --include-headers | ||
|
||
virtual patch | ||
virtual report | ||
virtual context | ||
|
||
@r1 depends on patch@ | ||
identifier fn; | ||
typedef bool; | ||
symbol false; | ||
symbol true; | ||
@@ | ||
|
||
bool fn ( ... ) | ||
{ | ||
<... | ||
return | ||
( | ||
- 0 | ||
+ false | ||
| | ||
- 1 | ||
+ true | ||
) | ||
; | ||
...> | ||
} | ||
|
||
@r2 depends on report || context@ | ||
identifier fn; | ||
position p; | ||
@@ | ||
|
||
bool fn ( ... ) | ||
{ | ||
<... | ||
return | ||
( | ||
* 0@p | ||
| | ||
* 1@p | ||
) | ||
; | ||
...> | ||
} | ||
|
||
|
||
@script:python depends on report@ | ||
p << r2.p; | ||
fn << r2.fn; | ||
@@ | ||
msg = "WARNING: return of 0/1 in function '%s' with return type bool" % fn | ||
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