src/lib: Remove braces for single statements

Fix the following warning detected by checkpatch.pl:

WARNING: braces {} are not necessary for single statement blocks

TEST=Build and run on Galileo Gen2

Change-Id: Ie4b41f6fb75142ddd75103a55e0347ed85e7e873
Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Reviewed-on: https://review.coreboot.org/18697
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins)
This commit is contained in:
Lee Leahy
2017-03-08 17:37:06 -08:00
parent b2d834a93a
commit 2f919ec476
10 changed files with 23 additions and 46 deletions

View File

@ -18,15 +18,13 @@ unsigned long compute_ip_checksum(const void *addr, unsigned long length)
for(i = 0; i < length; i++) {
unsigned long v;
v = ptr[i];
if (i & 1) {
if (i & 1)
v <<= 8;
}
/* Add the new value */
sum += v;
/* Wrap around the carry */
if (sum > 0xFFFF) {
if (sum > 0xFFFF)
sum = (sum + (sum >> 16)) & 0xFFFF;
}
}
value.byte[0] = sum & 0xff;
value.byte[1] = (sum >> 8) & 0xff;
@ -46,8 +44,7 @@ unsigned long add_ip_checksums(unsigned long offset, unsigned long sum, unsigned
new = ((new >> 8) & 0xff) | ((new << 8) & 0xff00);
}
checksum = sum + new;
if (checksum > 0xFFFF) {
if (checksum > 0xFFFF)
checksum -= 0xFFFF;
}
return (~checksum) & 0xFFFF;
}