diff --git a/src/lib/edid.c b/src/lib/edid.c index 50bb2c282a..a506ab1131 100644 --- a/src/lib/edid.c +++ b/src/lib/edid.c @@ -553,10 +553,10 @@ detailed_block(struct edid *result_edid, unsigned char *x, int in_extension, out->mode.va + out->mode.vso + out->mode.vspw, out->mode.va + out->mode.vbl, out->mode.vborder, out->mode.phsync, out->mode.pvsync, - extra_info.syncmethod, x[17] & 0x80 ?" interlaced" : "", + extra_info.syncmethod, x[17] & 0x80 ? " interlaced" : "", extra_info.stereo); - if (! c->did_detailed_timing) { + if (!c->did_detailed_timing) { printk(BIOS_SPEW, "Did detailed timing\n"); c->did_detailed_timing = 1; *result_edid = *out; @@ -654,7 +654,7 @@ cea_video_block(unsigned char *x) int length = x[0] & 0x1f; for (i = 1; i < length; i++) - printk(BIOS_SPEW," VIC %02d %s\n", x[i] & 0x7f, + printk(BIOS_SPEW, " VIC %02d %s\n", x[i] & 0x7f, x[i] & 0x80 ? "(native)" : ""); } @@ -995,7 +995,7 @@ static void dump_breakdown(unsigned char *edid) printk(BIOS_SPEW, "Extracted contents:\n"); print_subsection("header", edid, 0, 7); print_subsection("serial number", edid, 8, 17); - print_subsection("version", edid,18, 19); + print_subsection("version", edid, 18, 19); print_subsection("basic params", edid, 20, 24); print_subsection("chroma info", edid, 25, 34); print_subsection("established", edid, 35, 37); @@ -1610,7 +1610,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/gcov-glue.c b/src/lib/gcov-glue.c index 45c3efa5a8..9d401bd4be 100644 --- a/src/lib/gcov-glue.c +++ b/src/lib/gcov-glue.c @@ -129,7 +129,7 @@ static void setbuf(FILE *stream, char *buf) static void coverage_init(void *unused) { extern long __CTOR_LIST__; - typedef void (*func_ptr)(void) ; + typedef void (*func_ptr)(void); func_ptr *ctor = (func_ptr *) &__CTOR_LIST__; if (ctor == NULL) return; diff --git a/src/lib/gcov-io.h b/src/lib/gcov-io.h index 89cbe49e7c..6644e27474 100644 --- a/src/lib/gcov-io.h +++ b/src/lib/gcov-io.h @@ -300,7 +300,7 @@ typedef HOST_WIDEST_INT gcov_type; #include "gcov-iov.h" /* Convert a magic or version number to a 4 character string. */ -#define GCOV_UNSIGNED2STRING(ARRAY,VALUE) \ +#define GCOV_UNSIGNED2STRING(ARRAY, VALUE) \ ((ARRAY)[0] = (char)((VALUE) >> 24), \ (ARRAY)[1] = (char)((VALUE) >> 16), \ (ARRAY)[2] = (char)((VALUE) >> 8), \ @@ -387,12 +387,12 @@ typedef HOST_WIDEST_INT gcov_type; #define GCOV_TAG_MASK(TAG) (((TAG) - 1) ^ (TAG)) /* Return nonzero if SUB is an immediate subtag of TAG. */ -#define GCOV_TAG_IS_SUBTAG(TAG,SUB) \ +#define GCOV_TAG_IS_SUBTAG(TAG, SUB) \ (GCOV_TAG_MASK(TAG) >> 8 == GCOV_TAG_MASK(SUB) \ && !(((SUB) ^ (TAG)) & ~GCOV_TAG_MASK(TAG))) /* Return nonzero if SUB is at a sublevel to TAG. */ -#define GCOV_TAG_IS_SUBLEVEL(TAG,SUB) \ +#define GCOV_TAG_IS_SUBLEVEL(TAG, SUB) \ (GCOV_TAG_MASK(TAG) > GCOV_TAG_MASK(SUB)) /* Basic block flags. */ diff --git a/src/lib/imd.c b/src/lib/imd.c index 2fc6fac38c..83030d7b14 100644 --- a/src/lib/imd.c +++ b/src/lib/imd.c @@ -636,7 +636,7 @@ int imd_entry_remove(const struct imd *imd, const struct imd_entry *entry) imdr = imd_entry_to_imdr(imd, entry); if (imdr == NULL) - return - 1; + return -1; r = imdr_root(imdr); diff --git a/src/lib/jpeg.c b/src/lib/jpeg.c index 751ef0e624..7fb151d9b8 100644 --- a/src/lib/jpeg.c +++ b/src/lib/jpeg.c @@ -600,10 +600,10 @@ static void dec_makehuff(struct dec_hufftbl *hu, int *hufflen, unsigned char *hu i); if (v && x < (1 << (v - 1))) x += (-1 << v) + 1; - x = x << 16 | (hu-> vals[k] & 0xf0) << 4 | + x = x << 16 | (hu->vals[k] & 0xf0) << 4 | (DECBITS - (i + 1 + v)) | 128; } else - x = v << 16 | (hu-> vals[k] & 0xf0) << 4 | + x = v << 16 | (hu->vals[k] & 0xf0) << 4 | (DECBITS - (i + 1)); hu->llvals[c | d] = x; } @@ -633,11 +633,11 @@ static void dec_makehuff(struct dec_hufftbl *hu, int *hufflen, unsigned char *hu #define C5IC1 ((PREC)IFIX(0.566454497)) /* c5/c1 */ #define C7IC1 ((PREC)IFIX(0.198912367)) /* c7/c1 */ -#define XPP(a,b) (t = a + b, b = a - b, a = t) -#define XMP(a,b) (t = a - b, b = a + b, a = t) -#define XPM(a,b) (t = a + b, b = b - a, a = t) +#define XPP(a, b) (t = a + b, b = a - b, a = t) +#define XMP(a, b) (t = a - b, b = a + b, a = t) +#define XPM(a, b) (t = a + b, b = b - a, a = t) -#define ROT(a,b,s,c) (t = IMULT(a + b, s), \ +#define ROT(a, b, s, c) (t = IMULT(a + b, s), \ a = IMULT(a, c - s) + t, \ b = IMULT(b, c + s) - t) @@ -810,7 +810,7 @@ static void initcol(PREC q[][64]) } /* This is optimized for the stupid sun SUNWspro compiler. */ -#define STORECLAMP(a,x) \ +#define STORECLAMP(a, x) \ ( \ (a) = (x), \ (unsigned int)(x) >= 256 ? \ @@ -825,8 +825,8 @@ static void initcol(PREC q[][64]) #define CBCRCG(yin, xin) \ ( \ - cb = outc[0 +yin*8+xin], \ - cr = outc[64+yin*8+xin], \ + cb = outc[0 + yin * 8 + xin], \ + cr = outc[64 + yin * 8 + xin], \ cg = (50 * cb + 130 * cr + 128) >> 8 \ ) @@ -834,8 +834,8 @@ static void initcol(PREC q[][64]) #define CBCRCG(yin, xin) \ ( \ - cb = outc[0 +yin*8+xin], \ - cr = outc[64+yin*8+xin], \ + cb = outc[0 + yin*8 + xin], \ + cr = outc[64 + yin*8 + xin], \ cg = (3 * cb + 8 * cr) >> 4 \ ) diff --git a/src/lib/libgcov.c b/src/lib/libgcov.c index d1d2c6e769..3e94664cf3 100644 --- a/src/lib/libgcov.c +++ b/src/lib/libgcov.c @@ -248,7 +248,7 @@ buffer_fn_data(const char *filename, const struct gcov_info *gi_ptr, return &fn_buffer->next; fail: - fprintf(stderr, "profiling:%s:Function %u %s %u \n", filename, fn_ix, + fprintf(stderr, "profiling:%s:Function %u %s %u\n", filename, fn_ix, len ? "cannot allocate" : "counter mismatch", len ? len : ix); return (struct gcov_fn_buffer **)free_fn_data(gi_ptr, fn_buffer, ix); @@ -289,7 +289,7 @@ gcov_version(struct gcov_info *ptr, gcov_unsigned_t version, fprintf(stderr, "profiling:%s:Version mismatch - expected %.4s got %.4s\n", - filename? filename : ptr->filename, e, v); + filename ? filename : ptr->filename, e, v); return 0; } return 1; @@ -603,7 +603,7 @@ gcov_exit(void) read_error:; fprintf(stderr, "profiling:%s:%s merging\n", gi_filename, - error < 0 ? "Overflow": "Error"); + error < 0 ? "Overflow" : "Error"); goto read_fatal; @@ -986,7 +986,7 @@ void __gcov_average_profiler(gcov_type *counters, gcov_type value) { counters[0] += value; - counters[1] ++; + counters[1]++; } #endif diff --git a/src/lib/lzmadecode.c b/src/lib/lzmadecode.c index c0efda5f8d..d2769d9e8f 100644 --- a/src/lib/lzmadecode.c +++ b/src/lib/lzmadecode.c @@ -37,9 +37,15 @@ : ((((uintptr_t) Buffer & 3) || ((SizeT) (BufferLim - Buffer) <= 4)) ? (*Buffer++) \ : ((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; }} +#define RC_INIT2 Code = 0; Range = 0xFFFFFFFF; \ +{ \ + 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; } @@ -57,7 +63,7 @@ { UpdateBit0(p); mi <<= 1; A0; } else \ { UpdateBit1(p); mi = (mi + mi) + 1; A1; } -#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;) +#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ;, ;) #define RangeDecoderBitTreeDecode(probs, numLevels, res) \ { \ @@ -192,7 +198,7 @@ int LzmaDecode(CLzmaDecoderState *vs, while (nowPos < outSize) { CProb *prob; UInt32 bound; - int posState = (int)((nowPos)& posStateMask); + int posState = (int)((nowPos)&posStateMask); prob = p + IsMatch + (state << kNumPosBitsMax) + posState; IfBit0(prob) { @@ -346,7 +352,7 @@ int LzmaDecode(CLzmaDecoderState *vs, int mi = 1; do { CProb *prob3 = prob + mi; - RC_GET_BIT2(prob3, mi, ; , rep0 |= i); + RC_GET_BIT2(prob3, mi, ;, rep0 |= i); i <<= 1; } while (--numDirectBits != 0); } diff --git a/src/lib/lzmadecode.h b/src/lib/lzmadecode.h index 892ad403db..95e01fb129 100644 --- a/src/lib/lzmadecode.h +++ b/src/lib/lzmadecode.h @@ -42,7 +42,7 @@ typedef struct _CLzmaProperties { int lc; int lp; int pb; -}CLzmaProperties; +} CLzmaProperties; int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size); diff --git a/src/lib/ramtest.c b/src/lib/ramtest.c index 6d12060bfc..806e7d75a5 100644 --- a/src/lib/ramtest.c +++ b/src/lib/ramtest.c @@ -84,7 +84,7 @@ static int ram_bitset_nodie(unsigned long start) uint8_t verbose = 0; printk(BIOS_DEBUG, "DRAM bitset write: 0x%08lx\n", start); - for (idx=0; idx<0x400; idx+=4) { + for (idx = 0; idx < 0x400; idx += 4) { test_pattern(idx, &addr, &value); write_phys(start + addr, value); } @@ -94,7 +94,7 @@ static int ram_bitset_nodie(unsigned long start) printk(BIOS_DEBUG, "DRAM bitset verify: 0x%08lx\n", start); failures = 0; - for (idx=0; idx<0x400; idx+=4) { + for (idx = 0; idx < 0x400; idx += 4) { test_pattern(idx, &addr, &value); value2 = read_phys(start + addr); @@ -162,7 +162,7 @@ int ram_check_noprint_nodie(unsigned long start, unsigned long stop) unsigned short int idx; unsigned char failed, failures; - for (idx=0; idx<0x400; idx+=4) { + for (idx = 0; idx < 0x400; idx += 4) { test_pattern(idx, &addr, &value); write_phys(start + addr, value); } @@ -171,7 +171,7 @@ int ram_check_noprint_nodie(unsigned long start, unsigned long stop) phys_memory_barrier(); failures = 0; - for (idx=0; idx<0x400; idx+=4) { + for (idx = 0; idx < 0x400; idx += 4) { test_pattern(idx, &addr, &value); value2 = read_phys(start + addr); @@ -189,19 +189,19 @@ static void __quick_ram_check(uintptr_t dst) write_phys(dst, 0x55555555); phys_memory_barrier(); if (read_phys(dst) != 0x55555555) - fail=1; + fail = 1; write_phys(dst, 0xaaaaaaaa); phys_memory_barrier(); if (read_phys(dst) != 0xaaaaaaaa) - fail=1; + fail = 1; write_phys(dst, 0x00000000); phys_memory_barrier(); if (read_phys(dst) != 0x00000000) - fail=1; + fail = 1; write_phys(dst, 0xffffffff); phys_memory_barrier(); if (read_phys(dst) != 0xffffffff) - fail=1; + fail = 1; write_phys(dst, backup); if (fail) { diff --git a/src/lib/stack.c b/src/lib/stack.c index 590fe27ed7..00c145aa3f 100644 --- a/src/lib/stack.c +++ b/src/lib/stack.c @@ -33,7 +33,7 @@ int checkstack(void *top_of_stack, int core) int i; u32 *stack = (u32 *) (top_of_stack - stack_size); - if (stack[0] != 0xDEADBEEF){ + if (stack[0] != 0xDEADBEEF) { printk(BIOS_ERR, "Stack overrun on CPU%d (address %p overwritten). " "Increase stack from current %zu bytes\n", core, stack, stack_size); @@ -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/thread.c b/src/lib/thread.c index 703034b8a8..30dd5e5219 100644 --- a/src/lib/thread.c +++ b/src/lib/thread.c @@ -186,7 +186,7 @@ static void asmlinkage call_wrapper_block_state(void *arg) /* Prepare a thread so that it starts by executing thread_entry(thread_arg). * Within thread_entry() it will call func(arg). */ static void prepare_thread(struct thread *t, void *func, void *arg, - asmlinkage void(*thread_entry)(void *), + asmlinkage void (*thread_entry)(void *), void *thread_arg) { /* Stash the function and argument to run. */ diff --git a/src/lib/timer_queue.c b/src/lib/timer_queue.c index 7cc814bee1..5eaaa936f6 100644 --- a/src/lib/timer_queue.c +++ b/src/lib/timer_queue.c @@ -165,7 +165,7 @@ int timer_sched_callback(struct timeout_callback *tocb, unsigned long us) { struct mono_time current_time; - if ((long)us< 0) + if ((long)us < 0) return -1; timer_monotonic_get(¤t_time);