summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/compute_ip_checksum.c2
-rw-r--r--src/lib/coreboot_table.c2
-rw-r--r--src/lib/delay.c4
-rw-r--r--src/lib/edid.c8
-rw-r--r--src/lib/generic_dump_spd.c10
-rw-r--r--src/lib/generic_sdram.c4
-rw-r--r--src/lib/gpio.c2
-rw-r--r--src/lib/lzmadecode.c10
-rw-r--r--src/lib/memcmp.c2
-rw-r--r--src/lib/memmove.c2
-rw-r--r--src/lib/primitive_memtest.c4
-rw-r--r--src/lib/selfboot.c6
-rw-r--r--src/lib/spd_bin.c2
-rw-r--r--src/lib/stack.c2
-rw-r--r--src/lib/tpm2_tlcl.c2
15 files changed, 31 insertions, 31 deletions
diff --git a/src/lib/compute_ip_checksum.c b/src/lib/compute_ip_checksum.c
index 9bd3e0a2cb..0d3394e712 100644
--- a/src/lib/compute_ip_checksum.c
+++ b/src/lib/compute_ip_checksum.c
@@ -15,7 +15,7 @@ unsigned long compute_ip_checksum(const void *addr, unsigned long length)
*/
sum = 0;
ptr = addr;
- for(i = 0; i < length; i++) {
+ for (i = 0; i < length; i++) {
unsigned long v;
v = ptr[i];
if (i & 1)
diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c
index e25a498f06..c1a2d9be4a 100644
--- a/src/lib/coreboot_table.c
+++ b/src/lib/coreboot_table.c
@@ -394,7 +394,7 @@ static void lb_strings(struct lb_header *header)
{ LB_TAG_COMPILE_TIME, coreboot_compile_time, },
};
unsigned int i;
- for(i = 0; i < ARRAY_SIZE(strings); i++) {
+ for (i = 0; i < ARRAY_SIZE(strings); i++) {
struct lb_string *rec;
size_t len;
rec = (struct lb_string *)lb_new_record(header);
diff --git a/src/lib/delay.c b/src/lib/delay.c
index 5c0916f349..7f478778dd 100644
--- a/src/lib/delay.c
+++ b/src/lib/delay.c
@@ -2,12 +2,12 @@
void mdelay(unsigned int msecs)
{
unsigned int i;
- for(i = 0; i < msecs; i++)
+ for (i = 0; i < msecs; i++)
udelay(1000);
}
void delay(unsigned int secs)
{
unsigned int i;
- for(i = 0; i < secs; i++)
+ for (i = 0; i < secs; i++)
mdelay(1000);
}
diff --git a/src/lib/edid.c b/src/lib/edid.c
index 4fb361aa0f..7138b8b256 100644
--- a/src/lib/edid.c
+++ b/src/lib/edid.c
@@ -381,7 +381,7 @@ detailed_block(struct edid *result_edid, unsigned char *x, int in_extension,
c->has_valid_range_descriptor = 0;
printk(BIOS_SPEW, "Preferred aspect ratio: ");
- switch((x[15] & 0xe0) >> 5) {
+ switch ((x[15] & 0xe0) >> 5) {
case 0x00: printk(BIOS_SPEW, "4:3"); break;
case 0x01: printk(BIOS_SPEW, "16:9"); break;
case 0x02: printk(BIOS_SPEW, "16:10"); break;
@@ -907,7 +907,7 @@ parse_extension(struct edid *out, unsigned char *x, struct edid_context *c)
int conformant_extension = 0;
printk(BIOS_SPEW, "\n");
- switch(x[0]) {
+ switch (x[0]) {
case 0x02:
printk(BIOS_SPEW, "CEA extension block\n");
extension_version(out, x);
@@ -1345,7 +1345,7 @@ int decode_edid(unsigned char *edid, int size, struct edid *out)
* by v1.3 and we are unlikely to use any EDID 2.0 panels, we ignore
* that case now and can fix it when we need to use a real 2.0 panel.
*/
- for(i = 128; i < size; i += 128)
+ for (i = 128; i < size; i += 128)
c.nonconformant_extension +=
parse_extension(out, &edid[i], &c);
@@ -1562,7 +1562,7 @@ void set_vbe_mode_info_valid(const struct edid *edid, uintptr_t fb_addr)
edid_fb.bits_per_pixel = edid->framebuffer_bits_per_pixel;
edid_fb.reserved_mask_pos = 0;
edid_fb.reserved_mask_size = 0;
- switch(edid->framebuffer_bits_per_pixel){
+ switch (edid->framebuffer_bits_per_pixel){
case 32:
case 24:
/* packed into 4-byte words */
diff --git a/src/lib/generic_dump_spd.c b/src/lib/generic_dump_spd.c
index f18bfa627e..63e47a2d28 100644
--- a/src/lib/generic_dump_spd.c
+++ b/src/lib/generic_dump_spd.c
@@ -7,13 +7,13 @@ static void dump_spd_registers(const struct mem_controller *ctrl)
{
int i;
printk(BIOS_DEBUG, "\n");
- for(i = 0; i < 4; i++) {
+ for (i = 0; i < 4; i++) {
unsigned int device;
device = ctrl->channel0[i];
if (device) {
int j;
printk(BIOS_DEBUG, "dimm: %02x.0: %02x", i, device);
- for(j = 0; j < 256; j++) {
+ for (j = 0; j < 256; j++) {
int status;
unsigned int char byte;
if ((j & 0xf) == 0)
@@ -32,7 +32,7 @@ static void dump_spd_registers(const struct mem_controller *ctrl)
if (device) {
int j;
printk(BIOS_DEBUG, "dimm: %02x.1: %02x", i, device);
- for(j = 0; j < 256; j++) {
+ for (j = 0; j < 256; j++) {
int status;
unsigned int char byte;
if ((j & 0xf) == 0)
@@ -56,11 +56,11 @@ void dump_spd_registers(void)
unsigned int device;
device = SMBUS_MEM_DEVICE_START;
printk(BIOS_DEBUG, "\n");
- while(device <= SMBUS_MEM_DEVICE_END) {
+ while (device <= SMBUS_MEM_DEVICE_END) {
int status = 0;
int i;
printk(BIOS_DEBUG, "dimm %02x", device);
- for(i = 0; (i < 256) && (status == 0); i++) {
+ for (i = 0; (i < 256) && (status == 0); i++) {
unsigned int char byte;
if ((i % 20) == 0)
printk(BIOS_DEBUG, "\n%3d: ", i);
diff --git a/src/lib/generic_sdram.c b/src/lib/generic_sdram.c
index a79d822a52..f050f86265 100644
--- a/src/lib/generic_sdram.c
+++ b/src/lib/generic_sdram.c
@@ -9,7 +9,7 @@ void sdram_initialize(int controllers, const struct mem_controller *ctrl)
{
int i;
/* Set the registers we can set once to reasonable values */
- for(i = 0; i < controllers; i++) {
+ for (i = 0; i < controllers; i++) {
printk(BIOS_DEBUG, "Ram1.%02x\n", i);
#if CONFIG_RAMINIT_SYSINFO
@@ -20,7 +20,7 @@ void sdram_initialize(int controllers, const struct mem_controller *ctrl)
}
/* Now setup those things we can auto detect */
- for(i = 0; i < controllers; i++) {
+ for (i = 0; i < controllers; i++) {
printk(BIOS_DEBUG, "Ram2.%02x\n", i);
#if CONFIG_RAMINIT_SYSINFO
diff --git a/src/lib/gpio.c b/src/lib/gpio.c
index 03cc455a70..ca0aebedf5 100644
--- a/src/lib/gpio.c
+++ b/src/lib/gpio.c
@@ -137,7 +137,7 @@ int _gpio_base3_value(gpio_t gpio[], int num_gpio, int binary_first)
* now. We know that there can be no binary numbers 1020-102X.
*/
if (binary_first && !has_z) {
- switch(temp) {
+ switch (temp) {
case 0: /* Ignore '0' digits. */
break;
case 1: /* Account for binaries 0 to 2^index - 1. */
diff --git a/src/lib/lzmadecode.c b/src/lib/lzmadecode.c
index fbf15964a6..2f1a214fa5 100644
--- a/src/lib/lzmadecode.c
+++ b/src/lib/lzmadecode.c
@@ -38,7 +38,7 @@
: ((look_ahead.dw = *(UInt32 *)Buffer), (Buffer += 4), (look_ahead_ptr = 1), look_ahead.raw[0])))
#define RC_INIT2 Code = 0; Range = 0xFFFFFFFF; \
- { int i; for(i = 0; i < 5; i++) { RC_TEST; Code = (Code << 8) | RC_READ_BYTE; }}
+ { int i; for (i = 0; i < 5; i++) { RC_TEST; Code = (Code << 8) | RC_READ_BYTE; }}
#define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; }
@@ -60,7 +60,7 @@
#define RangeDecoderBitTreeDecode(probs, numLevels, res) \
{ int i = numLevels; res = 1; \
- do { CProb *cp = probs + res; RC_GET_BIT(cp, res) } while(--i != 0); \
+ do { CProb *cp = probs + res; RC_GET_BIT(cp, res) } while (--i != 0); \
res -= (1 << numLevels); }
@@ -178,7 +178,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
RC_INIT(inStream, inSize);
- while(nowPos < outSize)
+ while (nowPos < outSize)
{
CProb *prob;
UInt32 bound;
@@ -375,7 +375,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
RC_GET_BIT2(prob3, mi, ; , rep0 |= i);
i <<= 1;
}
- while(--numDirectBits != 0);
+ while (--numDirectBits != 0);
}
}
else
@@ -399,7 +399,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
len--;
outStream[nowPos++] = previousByte;
}
- while(len != 0 && nowPos < outSize);
+ while (len != 0 && nowPos < outSize);
}
}
RC_NORMALIZE;
diff --git a/src/lib/memcmp.c b/src/lib/memcmp.c
index 46f13a41bd..89059a18bd 100644
--- a/src/lib/memcmp.c
+++ b/src/lib/memcmp.c
@@ -7,7 +7,7 @@ int memcmp(const void *src1, const void *src2, size_t bytes)
s1 = src1;
s2 = src2;
result = 0;
- while((bytes > 0) && (result == 0)) {
+ while ((bytes > 0) && (result == 0)) {
result = *s1 - *s2;
bytes--;
s1++;
diff --git a/src/lib/memmove.c b/src/lib/memmove.c
index 6a43ed4528..fd75135788 100644
--- a/src/lib/memmove.c
+++ b/src/lib/memmove.c
@@ -10,7 +10,7 @@ void *memmove(void *vdest, const void *vsrc, size_t count)
} else {
src += count - 1;
dest += count - 1;
- while(count--)
+ while (count--)
*dest-- = *src--;
}
return vdest;
diff --git a/src/lib/primitive_memtest.c b/src/lib/primitive_memtest.c
index 6e58233288..c699e8906b 100644
--- a/src/lib/primitive_memtest.c
+++ b/src/lib/primitive_memtest.c
@@ -25,7 +25,7 @@ int primitive_memtest(uintptr_t base, uintptr_t size)
printk(BIOS_SPEW, "Performing primitive memory test.\n");
printk(BIOS_SPEW, "DRAM start: 0x%08x, DRAM size: 0x%08x", base, size);
- for(i = base; i < base + (size - 1) - sizeof(p); i += sizeof(p)) {
+ for (i = base; i < base + (size - 1) - sizeof(p); i += sizeof(p)) {
if (i % 0x100000 == 0) {
if ((i % 0x800000) == 0)
printk(BIOS_SPEW, "\n");
@@ -38,7 +38,7 @@ int primitive_memtest(uintptr_t base, uintptr_t size)
}
printk(BIOS_SPEW, "\n\nReading back DRAM content");
- for(i = base; i < base + (size - 1) - sizeof(p); i += sizeof(p)) {
+ for (i = base; i < base + (size - 1) - sizeof(p); i += sizeof(p)) {
if (i % 0x100000 == 0) {
if ((i % 0x800000) == 0)
printk(BIOS_SPEW, "\n");
diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c
index 0746cb9011..f9f41d46df 100644
--- a/src/lib/selfboot.c
+++ b/src/lib/selfboot.c
@@ -369,7 +369,7 @@ static int load_self_segments(struct segment *head, struct prog *payload,
return 0;
}
- for(ptr = head->next; ptr != head; ptr = ptr->next) {
+ for (ptr = head->next; ptr != head; ptr = ptr->next) {
/*
* Add segments to bootmem memory map before a bounce buffer is
* allocated so that there aren't conflicts with the actual
@@ -391,7 +391,7 @@ static int load_self_segments(struct segment *head, struct prog *payload,
return 0;
}
- for(ptr = head->next; ptr != head; ptr = ptr->next) {
+ for (ptr = head->next; ptr != head; ptr = ptr->next) {
unsigned char *dest, *src, *middle, *end;
size_t len, memsz;
printk(BIOS_DEBUG, "Loading Segment: addr: 0x%016lx memsz: 0x%016lx filesz: 0x%016lx\n",
@@ -415,7 +415,7 @@ static int load_self_segments(struct segment *head, struct prog *payload,
end = dest + memsz;
/* Copy data from the initial buffer */
- switch(ptr->compression) {
+ switch (ptr->compression) {
case CBFS_COMPRESS_LZMA: {
printk(BIOS_DEBUG, "using LZMA\n");
timestamp_add_now(TS_START_ULZMA);
diff --git a/src/lib/spd_bin.c b/src/lib/spd_bin.c
index 8f358bb0af..ff00e6191e 100644
--- a/src/lib/spd_bin.c
+++ b/src/lib/spd_bin.c
@@ -199,7 +199,7 @@ int read_ddr3_spd_from_cbfs(u8 *buf, int idx)
u16 i;
printk(BIOS_WARNING, "\nDisplay the SPD");
for (i = 0; i < CONFIG_DIMM_SPD_SIZE; i++) {
- if((i % 16) == 0x00)
+ if ((i % 16) == 0x00)
printk(BIOS_WARNING, "\n%02x: ", i);
printk(BIOS_WARNING, "%02x ", buf[i]);
}
diff --git a/src/lib/stack.c b/src/lib/stack.c
index bebeea2c61..590fe27ed7 100644
--- a/src/lib/stack.c
+++ b/src/lib/stack.c
@@ -41,7 +41,7 @@ int checkstack(void *top_of_stack, int core)
return -1;
}
- for(i = 1; i < stack_size/sizeof(stack[0]); i++){
+ for (i = 1; i < stack_size/sizeof(stack[0]); i++){
if (stack[i] == 0xDEADBEEF)
continue;
printk(BIOS_SPEW, "CPU%d: stack: %p - %p, ",
diff --git a/src/lib/tpm2_tlcl.c b/src/lib/tpm2_tlcl.c
index 6c0cd6e2b2..3d65a95e97 100644
--- a/src/lib/tpm2_tlcl.c
+++ b/src/lib/tpm2_tlcl.c
@@ -360,7 +360,7 @@ uint32_t tlcl_define_space(uint32_t space_index, size_t space_size)
return TPM_E_NO_DEVICE;
/* Map TPM2 retrun codes into common vboot represenation. */
- switch(response->hdr.tpm_code) {
+ switch (response->hdr.tpm_code) {
case TPM2_RC_SUCCESS:
return TPM_SUCCESS;
case TPM2_RC_NV_DEFINED: