aboutsummaryrefslogtreecommitdiff
path: root/src/lib/libgcov.c
diff options
context:
space:
mode:
authorLee Leahy <leroy.p.leahy@intel.com>2017-03-10 15:51:04 -0800
committerLee Leahy <leroy.p.leahy@intel.com>2017-03-15 05:04:45 +0100
commit491c5b60d01d5fa7d27c281335343e67519e799c (patch)
tree7f0cfbfc22d25b6ed2a3e654dd88f515814688fd /src/lib/libgcov.c
parent006d73d2e224a06736e6a43b4109a3e70d344241 (diff)
src/lib: Move assignment out of if condition
Fix the following error detected by checkpatch: ERROR: do not use assignment in if condition TEST=Build and run on Galileo Gen2 Change-Id: I5a08d1647db66bd5d480f81e90d473999c222acf Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com> Reviewed-on: https://review.coreboot.org/18761 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/lib/libgcov.c')
-rw-r--r--src/lib/libgcov.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/libgcov.c b/src/lib/libgcov.c
index 2cfda0a364..ca5021f834 100644
--- a/src/lib/libgcov.c
+++ b/src/lib/libgcov.c
@@ -496,7 +496,8 @@ gcov_exit(void)
if (length != GCOV_TAG_SUMMARY_LENGTH)
goto read_mismatch;
gcov_read_summary(&tmp);
- if ((error = gcov_is_error()))
+ error = gcov_is_error();
+ if (error)
goto read_error;
if (summary_pos
|| tmp.checksum != crc32)
@@ -584,7 +585,8 @@ gcov_exit(void)
ci_ptr->num);
ci_ptr++;
}
- if ((error = gcov_is_error()))
+ error = gcov_is_error();
+ if (error)
goto read_error;
}
@@ -713,7 +715,8 @@ read_fatal:;
fn_buffer = free_fn_data(gi_ptr, fn_buffer,
GCOV_COUNTERS);
- if ((error = gcov_close()))
+ error = gcov_close();
+ if (error)
fprintf(stderr, error < 0 ?
"profiling:%s:Overflow writing\n" :
"profiling:%s:Error writing\n",