src/lib: Add space before (

Fix the following error detected by checkpatch.pl:

ERROR: space required before the open parenthesis '('

TEST=Build and run on Galileo Gen2

Change-Id: I8953fecbe75136ff989c9e3cf6c5e155dcee3c3b
Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Reviewed-on: https://review.coreboot.org/18698
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Lee Leahy
2017-03-08 18:02:24 -08:00
parent 2f919ec476
commit 45fde705b6
15 changed files with 31 additions and 31 deletions

View File

@ -15,7 +15,7 @@ unsigned long compute_ip_checksum(const void *addr, unsigned long length)
*/ */
sum = 0; sum = 0;
ptr = addr; ptr = addr;
for(i = 0; i < length; i++) { for (i = 0; i < length; i++) {
unsigned long v; unsigned long v;
v = ptr[i]; v = ptr[i];
if (i & 1) if (i & 1)

View File

@ -394,7 +394,7 @@ static void lb_strings(struct lb_header *header)
{ LB_TAG_COMPILE_TIME, coreboot_compile_time, }, { LB_TAG_COMPILE_TIME, coreboot_compile_time, },
}; };
unsigned int i; unsigned int i;
for(i = 0; i < ARRAY_SIZE(strings); i++) { for (i = 0; i < ARRAY_SIZE(strings); i++) {
struct lb_string *rec; struct lb_string *rec;
size_t len; size_t len;
rec = (struct lb_string *)lb_new_record(header); rec = (struct lb_string *)lb_new_record(header);

View File

@ -2,12 +2,12 @@
void mdelay(unsigned int msecs) void mdelay(unsigned int msecs)
{ {
unsigned int i; unsigned int i;
for(i = 0; i < msecs; i++) for (i = 0; i < msecs; i++)
udelay(1000); udelay(1000);
} }
void delay(unsigned int secs) void delay(unsigned int secs)
{ {
unsigned int i; unsigned int i;
for(i = 0; i < secs; i++) for (i = 0; i < secs; i++)
mdelay(1000); mdelay(1000);
} }

View File

@ -381,7 +381,7 @@ detailed_block(struct edid *result_edid, unsigned char *x, int in_extension,
c->has_valid_range_descriptor = 0; c->has_valid_range_descriptor = 0;
printk(BIOS_SPEW, "Preferred aspect ratio: "); 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 0x00: printk(BIOS_SPEW, "4:3"); break;
case 0x01: printk(BIOS_SPEW, "16:9"); break; case 0x01: printk(BIOS_SPEW, "16:9"); break;
case 0x02: printk(BIOS_SPEW, "16:10"); 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; int conformant_extension = 0;
printk(BIOS_SPEW, "\n"); printk(BIOS_SPEW, "\n");
switch(x[0]) { switch (x[0]) {
case 0x02: case 0x02:
printk(BIOS_SPEW, "CEA extension block\n"); printk(BIOS_SPEW, "CEA extension block\n");
extension_version(out, x); 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 * 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. * 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 += c.nonconformant_extension +=
parse_extension(out, &edid[i], &c); 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.bits_per_pixel = edid->framebuffer_bits_per_pixel;
edid_fb.reserved_mask_pos = 0; edid_fb.reserved_mask_pos = 0;
edid_fb.reserved_mask_size = 0; edid_fb.reserved_mask_size = 0;
switch(edid->framebuffer_bits_per_pixel){ switch (edid->framebuffer_bits_per_pixel){
case 32: case 32:
case 24: case 24:
/* packed into 4-byte words */ /* packed into 4-byte words */

View File

@ -7,13 +7,13 @@ static void dump_spd_registers(const struct mem_controller *ctrl)
{ {
int i; int i;
printk(BIOS_DEBUG, "\n"); printk(BIOS_DEBUG, "\n");
for(i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
unsigned int device; unsigned int device;
device = ctrl->channel0[i]; device = ctrl->channel0[i];
if (device) { if (device) {
int j; int j;
printk(BIOS_DEBUG, "dimm: %02x.0: %02x", i, device); printk(BIOS_DEBUG, "dimm: %02x.0: %02x", i, device);
for(j = 0; j < 256; j++) { for (j = 0; j < 256; j++) {
int status; int status;
unsigned int char byte; unsigned int char byte;
if ((j & 0xf) == 0) if ((j & 0xf) == 0)
@ -32,7 +32,7 @@ static void dump_spd_registers(const struct mem_controller *ctrl)
if (device) { if (device) {
int j; int j;
printk(BIOS_DEBUG, "dimm: %02x.1: %02x", i, device); printk(BIOS_DEBUG, "dimm: %02x.1: %02x", i, device);
for(j = 0; j < 256; j++) { for (j = 0; j < 256; j++) {
int status; int status;
unsigned int char byte; unsigned int char byte;
if ((j & 0xf) == 0) if ((j & 0xf) == 0)
@ -56,11 +56,11 @@ void dump_spd_registers(void)
unsigned int device; unsigned int device;
device = SMBUS_MEM_DEVICE_START; device = SMBUS_MEM_DEVICE_START;
printk(BIOS_DEBUG, "\n"); printk(BIOS_DEBUG, "\n");
while(device <= SMBUS_MEM_DEVICE_END) { while (device <= SMBUS_MEM_DEVICE_END) {
int status = 0; int status = 0;
int i; int i;
printk(BIOS_DEBUG, "dimm %02x", device); 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; unsigned int char byte;
if ((i % 20) == 0) if ((i % 20) == 0)
printk(BIOS_DEBUG, "\n%3d: ", i); printk(BIOS_DEBUG, "\n%3d: ", i);

View File

@ -9,7 +9,7 @@ void sdram_initialize(int controllers, const struct mem_controller *ctrl)
{ {
int i; int i;
/* Set the registers we can set once to reasonable values */ /* 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); printk(BIOS_DEBUG, "Ram1.%02x\n", i);
#if CONFIG_RAMINIT_SYSINFO #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 */ /* 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); printk(BIOS_DEBUG, "Ram2.%02x\n", i);
#if CONFIG_RAMINIT_SYSINFO #if CONFIG_RAMINIT_SYSINFO

View File

@ -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. * now. We know that there can be no binary numbers 1020-102X.
*/ */
if (binary_first && !has_z) { if (binary_first && !has_z) {
switch(temp) { switch (temp) {
case 0: /* Ignore '0' digits. */ case 0: /* Ignore '0' digits. */
break; break;
case 1: /* Account for binaries 0 to 2^index - 1. */ case 1: /* Account for binaries 0 to 2^index - 1. */

View File

@ -38,7 +38,7 @@
: ((look_ahead.dw = *(UInt32 *)Buffer), (Buffer += 4), (look_ahead_ptr = 1), look_ahead.raw[0]))) : ((look_ahead.dw = *(UInt32 *)Buffer), (Buffer += 4), (look_ahead_ptr = 1), look_ahead.raw[0])))
#define RC_INIT2 Code = 0; Range = 0xFFFFFFFF; \ #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; } #define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; }
@ -60,7 +60,7 @@
#define RangeDecoderBitTreeDecode(probs, numLevels, res) \ #define RangeDecoderBitTreeDecode(probs, numLevels, res) \
{ int i = numLevels; res = 1; \ { 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); } res -= (1 << numLevels); }
@ -178,7 +178,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
RC_INIT(inStream, inSize); RC_INIT(inStream, inSize);
while(nowPos < outSize) while (nowPos < outSize)
{ {
CProb *prob; CProb *prob;
UInt32 bound; UInt32 bound;
@ -375,7 +375,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
RC_GET_BIT2(prob3, mi, ; , rep0 |= i); RC_GET_BIT2(prob3, mi, ; , rep0 |= i);
i <<= 1; i <<= 1;
} }
while(--numDirectBits != 0); while (--numDirectBits != 0);
} }
} }
else else
@ -399,7 +399,7 @@ int LzmaDecode(CLzmaDecoderState *vs,
len--; len--;
outStream[nowPos++] = previousByte; outStream[nowPos++] = previousByte;
} }
while(len != 0 && nowPos < outSize); while (len != 0 && nowPos < outSize);
} }
} }
RC_NORMALIZE; RC_NORMALIZE;

View File

@ -7,7 +7,7 @@ int memcmp(const void *src1, const void *src2, size_t bytes)
s1 = src1; s1 = src1;
s2 = src2; s2 = src2;
result = 0; result = 0;
while((bytes > 0) && (result == 0)) { while ((bytes > 0) && (result == 0)) {
result = *s1 - *s2; result = *s1 - *s2;
bytes--; bytes--;
s1++; s1++;

View File

@ -10,7 +10,7 @@ void *memmove(void *vdest, const void *vsrc, size_t count)
} else { } else {
src += count - 1; src += count - 1;
dest += count - 1; dest += count - 1;
while(count--) while (count--)
*dest-- = *src--; *dest-- = *src--;
} }
return vdest; return vdest;

View File

@ -25,7 +25,7 @@ int primitive_memtest(uintptr_t base, uintptr_t size)
printk(BIOS_SPEW, "Performing primitive memory test.\n"); printk(BIOS_SPEW, "Performing primitive memory test.\n");
printk(BIOS_SPEW, "DRAM start: 0x%08x, DRAM size: 0x%08x", base, size); 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 % 0x100000 == 0) {
if ((i % 0x800000) == 0) if ((i % 0x800000) == 0)
printk(BIOS_SPEW, "\n"); 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"); 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 % 0x100000 == 0) {
if ((i % 0x800000) == 0) if ((i % 0x800000) == 0)
printk(BIOS_SPEW, "\n"); printk(BIOS_SPEW, "\n");

View File

@ -369,7 +369,7 @@ static int load_self_segments(struct segment *head, struct prog *payload,
return 0; 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 * Add segments to bootmem memory map before a bounce buffer is
* allocated so that there aren't conflicts with the actual * 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; 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; unsigned char *dest, *src, *middle, *end;
size_t len, memsz; size_t len, memsz;
printk(BIOS_DEBUG, "Loading Segment: addr: 0x%016lx memsz: 0x%016lx filesz: 0x%016lx\n", 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; end = dest + memsz;
/* Copy data from the initial buffer */ /* Copy data from the initial buffer */
switch(ptr->compression) { switch (ptr->compression) {
case CBFS_COMPRESS_LZMA: { case CBFS_COMPRESS_LZMA: {
printk(BIOS_DEBUG, "using LZMA\n"); printk(BIOS_DEBUG, "using LZMA\n");
timestamp_add_now(TS_START_ULZMA); timestamp_add_now(TS_START_ULZMA);

View File

@ -199,7 +199,7 @@ int read_ddr3_spd_from_cbfs(u8 *buf, int idx)
u16 i; u16 i;
printk(BIOS_WARNING, "\nDisplay the SPD"); printk(BIOS_WARNING, "\nDisplay the SPD");
for (i = 0; i < CONFIG_DIMM_SPD_SIZE; i++) { 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, "\n%02x: ", i);
printk(BIOS_WARNING, "%02x ", buf[i]); printk(BIOS_WARNING, "%02x ", buf[i]);
} }

View File

@ -41,7 +41,7 @@ int checkstack(void *top_of_stack, int core)
return -1; 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) if (stack[i] == 0xDEADBEEF)
continue; continue;
printk(BIOS_SPEW, "CPU%d: stack: %p - %p, ", printk(BIOS_SPEW, "CPU%d: stack: %p - %p, ",

View File

@ -360,7 +360,7 @@ uint32_t tlcl_define_space(uint32_t space_index, size_t space_size)
return TPM_E_NO_DEVICE; return TPM_E_NO_DEVICE;
/* Map TPM2 retrun codes into common vboot represenation. */ /* Map TPM2 retrun codes into common vboot represenation. */
switch(response->hdr.tpm_code) { switch (response->hdr.tpm_code) {
case TPM2_RC_SUCCESS: case TPM2_RC_SUCCESS:
return TPM_SUCCESS; return TPM_SUCCESS;
case TPM2_RC_NV_DEFINED: case TPM2_RC_NV_DEFINED: