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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user