diff options
author | Peter Senna Tschudin <peter.senna@gmail.com> | 2014-07-29 18:12:20 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-07-30 01:57:13 +0200 |
commit | 059802f961db9717412b6958111ca1cd1865726e (patch) | |
tree | d5cdc976411b8e08f853fd88516b06f55c5957be /scripts/checkversion.pl | |
parent | cpupower: bench: parse.c: Fix several minor errors (diff) | |
download | linux-059802f961db9717412b6958111ca1cd1865726e.tar.xz linux-059802f961db9717412b6958111ca1cd1865726e.zip |
cpupower: Remove redundant error check
Remove double checks, and move the call to print_error to the
first check. Replace break by return, and return 0 on success.
The simplified version of the coccinelle semantic patch that
fixes this issue is as follows:
// <smpl>
@@
expression E; identifier pr; expression list es;
@@
for(...;...;...){
...
- if (E) break;
+ if (E){
+ pr(es);
+ break;
+ }
...
}
- if(E) pr(es);
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'scripts/checkversion.pl')
0 files changed, 0 insertions, 0 deletions