diff options
author | Lee Leahy <leroy.p.leahy@intel.com> | 2017-03-10 15:51:04 -0800 |
---|---|---|
committer | Lee Leahy <leroy.p.leahy@intel.com> | 2017-03-15 05:04:45 +0100 |
commit | 491c5b60d01d5fa7d27c281335343e67519e799c (patch) | |
tree | 7f0cfbfc22d25b6ed2a3e654dd88f515814688fd /src/lib/jpeg.c | |
parent | 006d73d2e224a06736e6a43b4109a3e70d344241 (diff) | |
download | coreboot-491c5b60d01d5fa7d27c281335343e67519e799c.tar.xz |
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/jpeg.c')
-rw-r--r-- | src/lib/jpeg.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/lib/jpeg.c b/src/lib/jpeg.c index f06d490329..06827ea413 100644 --- a/src/lib/jpeg.c +++ b/src/lib/jpeg.c @@ -166,7 +166,8 @@ static int readtables(int till) for (;;) { if (getbyte() != 0xff) return -1; - if ((m = getbyte()) == till) + m = getbyte(); + if (m == till) break; switch (m) { @@ -455,15 +456,20 @@ static int fillbits(struct in *in, int le, unsigned int bi) } while (le <= 24) { b = *in->p++; - if (b == 0xff && (m = *in->p++) != 0) { - if (m == M_EOF) { - if (in->func && (m = in->func(in->data)) == 0) - continue; + if (b == 0xff) { + m = *in->p++; + if (m != 0) { + if (m == M_EOF) { + if (in->func) { + m = in->func(in->data); + if (m == 0) + continue; + } + in->marker = m; + if (le <= 16) + bi = bi << 16, le += 16; + break; } - in->marker = m; - if (le <= 16) - bi = bi << 16, le += 16; - break; } bi = bi << 8 | b; le += 8; @@ -477,7 +483,8 @@ static int dec_readmarker(struct in *in) int m; in->left = fillbits(in, in->left, in->bits); - if ((m = in->marker) == 0) + m = in->marker; + if (m == 0) return 0; in->left = 0; in->marker = 0; |