Commit e20a3191 authored by Lee Leahy's avatar Lee Leahy Committed by Martin Roth

src/lib: Use tabs instead of spaces

Fix the following errors and warnings detected by checkpatch.pl:

ERROR: code indent should use tabs where possible
ERROR: switch and case should be at the same indent
WARNING: Statements should start on a tabstop
WARNING: please, no spaces at the start of a line
WARNING: please, no space before tabs
WARNING: suspect code indent for conditional statements
WARNING: labels should not be indented

TEST=Build and run on Galileo Gen2

Change-Id: Iebcff26ad41ab6eb0027b871a1c06f3b52dd207c
Signed-off-by: default avatarLee Leahy <Leroy.P.Leahy@intel.com>
Reviewed-on: https://review.coreboot.org/18732
Tested-by: build bot (Jenkins)
Reviewed-by: default avatarMartin Roth <martinroth@google.com>
parent cdd7686a
......@@ -875,11 +875,9 @@ parse_cea(struct edid *out, unsigned char *x, struct edid_context *c)
if (offset < 4)
break;
if (version < 3) {
if (version < 3)
printk(BIOS_SPEW, "%d 8-byte timing descriptors\n", (offset - 4) / 8);
if (offset - 4 > 0)
/* do stuff */ ;
} else if (version == 3) {
else if (version == 3) {
int i;
printk(BIOS_SPEW, "%d bytes of CEA data\n", offset - 4);
for (i = 4; i < offset; i += (x[i] & 0x1f) + 1)
......@@ -1188,7 +1186,7 @@ int decode_edid(unsigned char *edid, int size, struct edid *out)
break;
}
extra_info.type = edid[0x14] & 0x0f;
} else if (c.claims_one_point_two) {
} else if (c.claims_one_point_two) {
conformance_mask = 0x7E;
if (edid[0x14] & 0x01)
printk(BIOS_SPEW, "DFP 1.x compatible TMDS\n");
......@@ -1273,18 +1271,18 @@ int decode_edid(unsigned char *edid, int size, struct edid *out)
/* FIXME: this is from 1.4 spec, check earlier */
if (analog) {
switch (edid[0x18] & 0x18) {
case 0x00:
printk(BIOS_SPEW, "Monochrome or grayscale display\n");
break;
case 0x08:
printk(BIOS_SPEW, "RGB color display\n");
break;
case 0x10:
printk(BIOS_SPEW, "Non-RGB color display\n");
break;
case 0x18:
printk(BIOS_SPEW, "Undefined display color type\n");
break;
case 0x00:
printk(BIOS_SPEW, "Monochrome or grayscale display\n");
break;
case 0x08:
printk(BIOS_SPEW, "RGB color display\n");
break;
case 0x10:
printk(BIOS_SPEW, "Non-RGB color display\n");
break;
case 0x18:
printk(BIOS_SPEW, "Undefined display color type\n");
break;
}
} else {
printk(BIOS_SPEW, "Supported color formats: RGB 4:4:4");
......
This diff is collapsed.
This diff is collapsed.
......@@ -26,7 +26,7 @@ void sdram_initialize(int controllers, const struct mem_controller *ctrl)
#if CONFIG_RAMINIT_SYSINFO
sdram_set_spd_registers(ctrl + i, sysinfo);
#else
sdram_set_spd_registers(ctrl + i);
sdram_set_spd_registers(ctrl + i);
#endif
}
......
......@@ -283,7 +283,7 @@ static void bs_run_timers(int drain) {}
#endif
static void bs_call_callbacks(struct boot_state *state,
boot_state_sequence_t seq)
boot_state_sequence_t seq)
{
struct boot_phase *phase = &state->phases[seq];
......@@ -385,8 +385,8 @@ static void bs_walk_state_machine(void)
}
static int boot_state_sched_callback(struct boot_state *state,
struct boot_state_callback *bscb,
boot_state_sequence_t seq)
struct boot_state_callback *bscb,
boot_state_sequence_t seq)
{
if (state->complete) {
printk(BIOS_WARNING,
......@@ -403,7 +403,7 @@ static int boot_state_sched_callback(struct boot_state *state,
}
int boot_state_sched_on_entry(struct boot_state_callback *bscb,
boot_state_t state_id)
boot_state_t state_id)
{
struct boot_state *state = &boot_states[state_id];
......@@ -411,7 +411,7 @@ int boot_state_sched_on_entry(struct boot_state_callback *bscb,
}
int boot_state_sched_on_exit(struct boot_state_callback *bscb,
boot_state_t state_id)
boot_state_t state_id)
{
struct boot_state *state = &boot_states[state_id];
......
......@@ -62,14 +62,14 @@ static inline const struct imd_entry *cbmem_to_imd(const struct cbmem_entry *e)
/* These are the different situations to handle:
* CONFIG_EARLY_CBMEM_INIT:
* In ramstage cbmem_initialize() attempts a recovery of the
* cbmem region set up by romstage. It uses cbmem_top() as the
* starting point of recovery.
* In ramstage cbmem_initialize() attempts a recovery of the
* cbmem region set up by romstage. It uses cbmem_top() as the
* starting point of recovery.
*
* In romstage, similar to ramstage, cbmem_initialize() needs to
* attempt recovery of the cbmem area using cbmem_top() as the limit.
* cbmem_initialize_empty() initializes an empty cbmem area from
* cbmem_top();
* In romstage, similar to ramstage, cbmem_initialize() needs to
* attempt recovery of the cbmem area using cbmem_top() as the limit.
* cbmem_initialize_empty() initializes an empty cbmem area from
* cbmem_top();
*
*/
static struct imd *imd_init_backing(struct imd *backing)
......
......@@ -267,15 +267,15 @@ void jpeg_fetch_size(unsigned char *buf, int *width, int *height)
int jpeg_check_size(unsigned char *buf, int width, int height)
{
datap = buf;
datap = buf;
getbyte();
getbyte();
readtables(M_SOF0);
getword();
getbyte();
if (height != getword() || width != getword())
if (height != getword() || width != getword())
return 0;
return 1;
return 1;
}
int jpeg_decode(unsigned char *buf, unsigned char *pic,
......@@ -476,14 +476,14 @@ static int dec_readmarker(struct in *in)
#define LEBI_GET(in) (le = in->left, bi = in->bits)
#define LEBI_PUT(in) (in->left = le, in->bits = bi)
#define GETBITS(in, n) ( \
(le < (n) ? le = fillbits(in, le, bi), bi = in->bits : 0), \
(le -= (n)), \
bi >> le & ((1 << (n)) - 1) \
)
#define GETBITS(in, n) ( \
(le < (n) ? le = fillbits(in, le, bi), bi = in->bits : 0), \
(le -= (n)), \
bi >> le & ((1 << (n)) - 1) \
)
#define UNGETBITS(in, n) ( \
le += (n) \
le += (n) \
)
......@@ -520,22 +520,22 @@ static int dec_rec2(struct in *in, struct dec_hufftbl *hu, int *runp, int c,
return c;
}
#define DEC_REC(in, hu, r, i) ( \
r = GETBITS(in, DECBITS), \
i = hu->llvals[r], \
i & 128 ? \
( \
UNGETBITS(in, i & 127), \
r = i >> 8 & 15, \
i >> 16 \
) \
: \
( \
LEBI_PUT(in), \
i = dec_rec2(in, hu, &r, r, i), \
LEBI_GET(in), \
i \
) \
#define DEC_REC(in, hu, r, i) ( \
r = GETBITS(in, DECBITS), \
i = hu->llvals[r], \
i & 128 ? \
( \
UNGETBITS(in, i & 127), \
r = i >> 8 & 15, \
i >> 16 \
) \
: \
( \
LEBI_PUT(in), \
i = dec_rec2(in, hu, &r, r, i), \
LEBI_GET(in), \
i \
) \
)
static void decode_mcus(struct in *in, int *dct, int n, struct scan *sc, int *maxp)
......@@ -604,7 +604,7 @@ static void dec_makehuff(struct dec_hufftbl *hu, int *hufflen, unsigned char *hu
(DECBITS - (i + 1 + v)) | 128;
} else
x = v << 16 | (hu-> vals[k] & 0xf0) << 4 |
(DECBITS - (i + 1));
(DECBITS - (i + 1));
hu->llvals[c | d] = x;
}
}
......@@ -641,25 +641,25 @@ static void dec_makehuff(struct dec_hufftbl *hu, int *hufflen, unsigned char *hu
a = IMULT(a, c - s) + t, \
b = IMULT(b, c + s) - t)
#define IDCT \
( \
XPP(t0, t1), \
XMP(t2, t3), \
t2 = IMULT(t2, IC4) - t3, \
XPP(t0, t3), \
XPP(t1, t2), \
XMP(t4, t7), \
XPP(t5, t6), \
XMP(t5, t7), \
t5 = IMULT(t5, IC4), \
ROT(t4, t6, S22, C22),\
t6 -= t7, \
t5 -= t6, \
t4 -= t5, \
XPP(t0, t7), \
XPP(t1, t6), \
XPP(t2, t5), \
XPP(t3, t4) \
#define IDCT \
( \
XPP(t0, t1), \
XMP(t2, t3), \
t2 = IMULT(t2, IC4) - t3, \
XPP(t0, t3), \
XPP(t1, t2), \
XMP(t4, t7), \
XPP(t5, t6), \
XMP(t5, t7), \
t5 = IMULT(t5, IC4), \
ROT(t4, t6, S22, C22), \
t6 -= t7, \
t5 -= t6, \
t4 -= t5, \
XPP(t0, t7), \
XPP(t1, t6), \
XPP(t2, t5), \
XPP(t3, t4) \
)
static unsigned char zig2[64] = {
......@@ -765,7 +765,7 @@ static void idctqtab(unsigned char *qin, PREC *qout)
for (i = 0; i < 8; i++)
for (j = 0; j < 8; j++)
qout[zig[i * 8 + j]] = qin[zig[i * 8 + j]] *
IMULT(aaidct[i], aaidct[j]);
IMULT(aaidct[i], aaidct[j]);
}
static void scaleidctqtab(PREC *q, PREC sc)
......@@ -812,11 +812,11 @@ static void initcol(PREC q[][64])
/* This is optimized for the stupid sun SUNWspro compiler. */
#define STORECLAMP(a,x) \
( \
(a) = (x), \
(unsigned int)(x) >= 256 ? \
((a) = (x) < 0 ? 0 : 255) \
: \
0 \
(a) = (x), \
(unsigned int)(x) >= 256 ? \
((a) = (x) < 0 ? 0 : 255) \
: \
0 \
)
#define CLAMP(x) ((unsigned int)(x) >= 256 ? ((x) < 0 ? 0 : 255) : (x))
......@@ -825,98 +825,98 @@ static void initcol(PREC q[][64])
#define CBCRCG(yin, xin) \
( \
cb = outc[0 +yin*8+xin], \
cr = outc[64+yin*8+xin], \
cg = (50 * cb + 130 * cr + 128) >> 8 \
cb = outc[0 +yin*8+xin], \
cr = outc[64+yin*8+xin], \
cg = (50 * cb + 130 * cr + 128) >> 8 \
)
#else
#define CBCRCG(yin, xin) \
( \
cb = outc[0 +yin*8+xin], \
cr = outc[64+yin*8+xin], \
cg = (3 * cb + 8 * cr) >> 4 \
cb = outc[0 +yin*8+xin], \
cr = outc[64+yin*8+xin], \
cg = (3 * cb + 8 * cr) >> 4 \
)
#endif
#define PIC(yin, xin, p, xout) \
( \
y = outy[(yin) * 8 + xin], \
STORECLAMP(p[(xout) * 3 + 0], y + cr), \
STORECLAMP(p[(xout) * 3 + 1], y - cg), \
STORECLAMP(p[(xout) * 3 + 2], y + cb) \
y = outy[(yin) * 8 + xin], \
STORECLAMP(p[(xout) * 3 + 0], y + cr), \
STORECLAMP(p[(xout) * 3 + 1], y - cg), \
STORECLAMP(p[(xout) * 3 + 2], y + cb) \
)
#ifdef __LITTLE_ENDIAN
#define PIC_16(yin, xin, p, xout, add) \
( \
y = outy[(yin) * 8 + xin], \
y = ((CLAMP(y + cr + add*2+1) & 0xf8) << 8) | \
((CLAMP(y - cg + add) & 0xfc) << 3) | \
((CLAMP(y + cb + add*2+1)) >> 3), \
p[(xout) * 2 + 0] = y & 0xff, \
p[(xout) * 2 + 1] = y >> 8 \
#define PIC_16(yin, xin, p, xout, add) \
( \
y = outy[(yin) * 8 + xin], \
y = ((CLAMP(y + cr + add*2+1) & 0xf8) << 8) | \
((CLAMP(y - cg + add) & 0xfc) << 3) | \
((CLAMP(y + cb + add*2+1)) >> 3), \
p[(xout) * 2 + 0] = y & 0xff, \
p[(xout) * 2 + 1] = y >> 8 \
)
#else
#ifdef CONFIG_PPC
#define PIC_16(yin, xin, p, xout, add) \
( \
y = outy[(yin) * 8 + xin], \
y = ((CLAMP(y + cr + add*2+1) & 0xf8) << 7) | \
((CLAMP(y - cg + add*2+1) & 0xf8) << 2) | \
((CLAMP(y + cb + add*2+1)) >> 3), \
p[(xout) * 2 + 0] = y >> 8, \
p[(xout) * 2 + 1] = y & 0xff \
#define PIC_16(yin, xin, p, xout, add) \
( \
y = outy[(yin) * 8 + xin], \
y = ((CLAMP(y + cr + add*2+1) & 0xf8) << 7) | \
((CLAMP(y - cg + add*2+1) & 0xf8) << 2) | \
((CLAMP(y + cb + add*2+1)) >> 3), \
p[(xout) * 2 + 0] = y >> 8, \
p[(xout) * 2 + 1] = y & 0xff \
)
#else
#define PIC_16(yin, xin, p, xout, add) \
( \
y = outy[(yin) * 8 + xin], \
y = ((CLAMP(y + cr + add*2+1) & 0xf8) << 8) | \
((CLAMP(y - cg + add) & 0xfc) << 3) | \
((CLAMP(y + cb + add*2+1)) >> 3), \
p[(xout) * 2 + 0] = y >> 8, \
p[(xout) * 2 + 1] = y & 0xff \
#define PIC_16(yin, xin, p, xout, add) \
( \
y = outy[(yin) * 8 + xin], \
y = ((CLAMP(y + cr + add*2+1) & 0xf8) << 8) | \
((CLAMP(y - cg + add) & 0xfc) << 3) | \
((CLAMP(y + cb + add*2+1)) >> 3), \
p[(xout) * 2 + 0] = y >> 8, \
p[(xout) * 2 + 1] = y & 0xff \
)
#endif
#endif
#define PIC_32(yin, xin, p, xout) \
( \
y = outy[(yin) * 8 + xin], \
STORECLAMP(p[(xout) * 4 + 0], y + cr), \
STORECLAMP(p[(xout) * 4 + 1], y - cg), \
STORECLAMP(p[(xout) * 4 + 2], y + cb), \
p[(xout) * 4 + 3] = 0 \
y = outy[(yin) * 8 + xin], \
STORECLAMP(p[(xout) * 4 + 0], y + cr), \
STORECLAMP(p[(xout) * 4 + 1], y - cg), \
STORECLAMP(p[(xout) * 4 + 2], y + cb), \
p[(xout) * 4 + 3] = 0 \
)
#define PIC221111(xin) \
( \
CBCRCG(0, xin), \
PIC(xin / 4 * 8 + 0, (xin & 3) * 2 + 0, pic0, xin * 2 + 0), \
PIC(xin / 4 * 8 + 0, (xin & 3) * 2 + 1, pic0, xin * 2 + 1), \
PIC(xin / 4 * 8 + 1, (xin & 3) * 2 + 0, pic1, xin * 2 + 0), \
PIC(xin / 4 * 8 + 1, (xin & 3) * 2 + 1, pic1, xin * 2 + 1) \
#define PIC221111(xin) \
( \
CBCRCG(0, xin), \
PIC(xin / 4 * 8 + 0, (xin & 3) * 2 + 0, pic0, xin * 2 + 0), \
PIC(xin / 4 * 8 + 0, (xin & 3) * 2 + 1, pic0, xin * 2 + 1), \
PIC(xin / 4 * 8 + 1, (xin & 3) * 2 + 0, pic1, xin * 2 + 0), \
PIC(xin / 4 * 8 + 1, (xin & 3) * 2 + 1, pic1, xin * 2 + 1) \
)
#define PIC221111_16(xin) \
( \
CBCRCG(0, xin), \
PIC_16(xin / 4 * 8 + 0, (xin & 3) * 2 + 0, pic0, xin * 2 + 0, 3), \
PIC_16(xin / 4 * 8 + 0, (xin & 3) * 2 + 1, pic0, xin * 2 + 1, 0), \
PIC_16(xin / 4 * 8 + 1, (xin & 3) * 2 + 0, pic1, xin * 2 + 0, 1), \
PIC_16(xin / 4 * 8 + 1, (xin & 3) * 2 + 1, pic1, xin * 2 + 1, 2) \
#define PIC221111_16(xin) \
( \
CBCRCG(0, xin), \
PIC_16(xin / 4 * 8 + 0, (xin & 3) * 2 + 0, pic0, xin * 2 + 0, 3), \
PIC_16(xin / 4 * 8 + 0, (xin & 3) * 2 + 1, pic0, xin * 2 + 1, 0), \
PIC_16(xin / 4 * 8 + 1, (xin & 3) * 2 + 0, pic1, xin * 2 + 0, 1), \
PIC_16(xin / 4 * 8 + 1, (xin & 3) * 2 + 1, pic1, xin * 2 + 1, 2) \
)
#define PIC221111_32(xin) \
( \
CBCRCG(0, xin), \
PIC_32(xin / 4 * 8 + 0, (xin & 3) * 2 + 0, pic0, xin * 2 + 0),\
PIC_32(xin / 4 * 8 + 0, (xin & 3) * 2 + 1, pic0, xin * 2 + 1),\
PIC_32(xin / 4 * 8 + 1, (xin & 3) * 2 + 0, pic1, xin * 2 + 0),\
PIC_32(xin / 4 * 8 + 1, (xin & 3) * 2 + 1, pic1, xin * 2 + 1) \
#define PIC221111_32(xin) \
( \
CBCRCG(0, xin), \
PIC_32(xin / 4 * 8 + 0, (xin & 3) * 2 + 0, pic0, xin * 2 + 0), \
PIC_32(xin / 4 * 8 + 0, (xin & 3) * 2 + 1, pic0, xin * 2 + 1), \
PIC_32(xin / 4 * 8 + 1, (xin & 3) * 2 + 0, pic1, xin * 2 + 0), \
PIC_32(xin / 4 * 8 + 1, (xin & 3) * 2 + 1, pic1, xin * 2 + 1) \
)
static void col221111(int *out, unsigned char *pic, int width)
......@@ -957,7 +957,7 @@ static void col221111_16(int *out, unsigned char *pic, int width)
for (i = 2; i > 0; i--) {
for (j = 4; j > 0; j--) {
for (k = 0; k < 8; k++)
PIC221111_16(k);
PIC221111_16(k);
outc += 8;
outy += 16;
pic0 += 2 * width;
......
This diff is collapsed.
This diff is collapsed.
......@@ -38,11 +38,10 @@ typedef UInt32 SizeT;
#define LZMA_PROPERTIES_SIZE 5
typedef struct _CLzmaProperties
{
int lc;
int lp;
int pb;
typedef struct _CLzmaProperties {
int lc;
int lp;
int pb;
}CLzmaProperties;
int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size);
......@@ -51,17 +50,14 @@ int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsDa
#define kLzmaNeedInitId (-2)
typedef struct _CLzmaDecoderState
{
CLzmaProperties Properties;
CProb *Probs;
typedef struct _CLzmaDecoderState {
CLzmaProperties Properties;
CProb *Probs;
} CLzmaDecoderState;
int LzmaDecode(CLzmaDecoderState *vs,
const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed,
unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed);
const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed,
unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed);
#endif
......@@ -17,22 +17,22 @@
#include <memrange.h>
static inline void range_entry_link(struct range_entry **prev_ptr,
struct range_entry *r)
struct range_entry *r)
{
r->next = *prev_ptr;
*prev_ptr = r;
}
static inline void range_entry_unlink(struct range_entry **prev_ptr,
struct range_entry *r)
struct range_entry *r)
{
*prev_ptr = r->next;
r->next = NULL;
}
static inline void range_entry_unlink_and_free(struct memranges *ranges,
struct range_entry **prev_ptr,
struct range_entry *r)
struct range_entry **prev_ptr,
struct range_entry *r)
{
range_entry_unlink(prev_ptr, r);
range_entry_link(&ranges->free_list, r);
......@@ -54,7 +54,7 @@ static struct range_entry *alloc_range(struct memranges *ranges)
static inline struct range_entry *
range_list_add(struct memranges *ranges, struct range_entry **prev_ptr,
resource_t begin, resource_t end, unsigned long tag)
resource_t begin, resource_t end, unsigned long tag)
{
struct range_entry *new_entry;
......@@ -102,8 +102,8 @@ static void merge_neighbor_entries(struct memranges *ranges)
}
static void remove_memranges(struct memranges *ranges,
resource_t begin, resource_t end,
unsigned long unused)
resource_t begin, resource_t end,
unsigned long unused)
{
struct range_entry *cur;
struct range_entry *next;
......@@ -136,7 +136,7 @@ static void remove_memranges(struct memranges *ranges,
if (end >= cur->end) {
begin = cur->end + 1;
range_entry_unlink_and_free(ranges, prev_ptr,
cur);
cur);
continue;
}
}
......@@ -152,7 +152,7 @@ static void remove_memranges(struct memranges *ranges,
/* Hole punched in middle of entry. */
if (begin > cur->begin && tmp_end < cur->end) {
range_list_add(ranges, &cur->next, end + 1, cur->end,
cur->tag);
cur->tag);
cur->end = begin - 1;
break;
}
......@@ -168,8 +168,8 @@ static void remove_memranges(struct memranges *ranges,
}
static void merge_add_memranges(struct memranges *ranges,
resource_t begin, resource_t end,
unsigned long tag)
resource_t begin, resource_t end,
unsigned long tag)
{
struct range_entry *cur;
struct range_entry **prev_ptr;
......@@ -202,7 +202,7 @@ static void merge_add_memranges(struct memranges *ranges,
}
void memranges_update_tag(struct memranges *ranges, unsigned long old_tag,
unsigned long new_tag)
unsigned long new_tag)
{
struct range_entry *r;
......@@ -215,12 +215,12 @@ void memranges_update_tag(struct memranges *ranges, unsigned long old_tag,
}
typedef void (*range_action_t)(struct memranges *ranges,
resource_t begin, resource_t end,
unsigned long tag);
resource_t begin, resource_t end,
unsigned long tag);
static void do_action(struct memranges *ranges,
resource_t base, resource_t size, unsigned long tag,
range_action_t action)
resource_t base, resource_t size, unsigned long tag,
range_action_t action)
{
resource_t end;
resource_t begin;
......@@ -238,13 +238,13 @@ static void do_action(struct memranges *ranges,
}
void memranges_create_hole(struct memranges *ranges,
resource_t base, resource_t size)
resource_t base, resource_t size)
{
do_action(ranges, base, size, -1, remove_memranges);
}
void memranges_insert(struct memranges *ranges,
resource_t base, resource_t size, unsigned long tag)
resource_t base, resource_t size, unsigned long tag)
{
do_action(ranges, base, size, tag, merge_add_memranges);
}
......@@ -267,9 +267,9 @@ static void collect_ranges(void *gp, struct device *dev, struct resource *res)
}
void memranges_add_resources_filter(struct memranges *ranges,
unsigned long mask, unsigned long match,
unsigned long tag,
memrange_filter_t filter)
unsigned long mask, unsigned long match,
unsigned long tag,
memrange_filter_t filter)
{
struct collect_context context;
......@@ -284,14 +284,14 @@ void memranges_add_resources_filter(struct memranges *ranges,
}
void memranges_add_resources(struct memranges *ranges,
unsigned long mask, unsigned long match,
unsigned long tag)
unsigned long mask, unsigned long match,
unsigned long tag)
{
memranges_add_resources_filter(ranges, mask, match, tag, NULL);
}
void memranges_init_empty(struct memranges *ranges, struct range_entry *to_free,
size_t num_free)
size_t num_free)
{
size_t i;
......@@ -303,8 +303,8 @@ void memranges_init_empty(struct memranges *ranges, struct range_entry *to_free,
}
void memranges_init(struct memranges *ranges,
unsigned long mask, unsigned long match,
unsigned long tag)
unsigned long mask, unsigned long match,
unsigned long tag)
{
memranges_init_empty(ranges, NULL, 0);
memranges_add_resources(ranges, mask, match, tag);
......@@ -314,12 +314,12 @@ void memranges_teardown(struct memranges *ranges)
{
while (ranges->entries != NULL) {
range_entry_unlink_and_free(ranges, &ranges->entries,
ranges->entries);
ranges->entries);
}
}
void memranges_fill_holes_up_to(struct memranges *ranges,
resource_t limit, unsigned long tag)
resource_t limit, unsigned long tag)
{
struct range_entry *cur;
struct range_entry *prev;
......@@ -341,7 +341,7 @@ void memranges_fill_holes_up_to(struct memranges *ranges,
if (end >= limit)
end = limit - 1;
range_list_add(ranges, &prev->next,
range_entry_end(prev), end, tag);
range_entry_end(prev), end, tag);
}
prev = cur;
......@@ -356,14 +356,14 @@ void memranges_fill_holes_up_to(struct memranges *ranges,
* to be added to cover the range up to the limit. */
if (prev != NULL && range_entry_end(prev) < limit)
range_list_add(ranges, &prev->next, range_entry_end(prev),
limit - 1, tag);
limit - 1, tag);
/* Merge all entries that were newly added. */
merge_neighbor_entries(ranges);
}
struct range_entry *memranges_next_entry(struct memranges *ranges,
const struct range_entry *r)
const struct range_entry *r)
{
return r->next;
}
......@@ -112,7 +112,7 @@ uint32_t tlcl_get_permanent_flags(TPM_PERMANENT_FLAGS *pflags)
}
uint32_t tlcl_get_flags(uint8_t *disable, uint8_t *deactivated,
uint8_t *nvlocked)
uint8_t *nvlocked)
{
VBDEBUG("MOCK_TPM: %s\n", __func__);
return TPM_E_NO_DEVICE;
......@@ -125,7 +125,7 @@ uint32_t tlcl_set_global_lock(void)
}
uint32_t tlcl_extend(int pcr_num, const uint8_t *in_digest,
uint8_t *out_digest)
uint8_t *out_digest)
{
VBDEBUG("MOCK_TPM: %s\n", __func__);
return TPM_E_NO_DEVICE;
......
......@@ -41,14 +41,14 @@
#endif
static inline void reg_script_set_dev(struct reg_script_context *ctx,
device_t dev)
device_t dev)
{
ctx->dev = dev;
ctx->res = NULL;
}
static inline void reg_script_set_step(struct reg_script_context *ctx,
const struct reg_script *step)
const struct reg_script *step)
{
ctx->step = step;
}
......@@ -603,7 +603,7 @@ static void reg_script_rxw(struct reg_script_context *ctx)
* as the previous one. That will run to completion and then move on to the
* next step of the previous context. */
static void reg_script_run_next(struct reg_script_context *ctx,
const struct reg_script *step);
const struct reg_script *step);
static void reg_script_run_step(struct reg_script_context *ctx,
......@@ -670,7 +670,7 @@ static void reg_script_run_with_context(struct reg_script_context *ctx)
}
static void reg_script_run_next(struct reg_script_context *prev_ctx,
const struct reg_script *step)
const struct reg_script *step)
{
struct reg_script_context ctx;
......
......@@ -33,7 +33,7 @@ static inline int rmodule_is_loaded(const struct rmodule *module)
/* Calculate a loaded program address based on the blob address. */
static inline void *rmodule_load_addr(const struct rmodule *module,
uintptr_t blob_addr)
uintptr_t blob_addr)
{
char *loc = module->location;
return &loc[blob_addr - module->header->module_link_start_address];
......@@ -66,7 +66,7 @@ int rmodule_parse(void *ptr, struct rmodule *module)
/* The payload lives after the header. */
module->payload = &base[rhdr->payload_begin_offset];
module->payload_size = rhdr->payload_end_offset -