src/lib: Fix space between type, * and variable name

Fix the following errors detected by checkpatch.pl:

ERROR: "foo* bar" should be "foo *bar"
ERROR: "(foo*)" should be "(foo *)"
ERROR: "foo * const * bar" should be "foo * const *bar"

TEST=Build and run on Galileo Gen2

Change-Id: I0d20ca360d8829f7d7670bacf0da4a0300bfb0c1
Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Reviewed-on: https://review.coreboot.org/18696
Tested-by: build bot (Jenkins)
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Lee Leahy
2017-03-08 16:52:22 -08:00
parent 75b859978a
commit b2d834a93a
10 changed files with 33 additions and 33 deletions

View File

@ -146,7 +146,7 @@ static inline int tohex4(unsigned int c)
return (c <= 9) ? (c + '0') : (c - 10 + 'a'); return (c <= 9) ? (c + '0') : (c - 10 + 'a');
} }
static void tohex16(unsigned int val, char* dest) static void tohex16(unsigned int val, char *dest)
{ {
dest[0] = tohex4(val>>12); dest[0] = tohex4(val>>12);
dest[1] = tohex4((val>>8) & 0xf); dest[1] = tohex4((val>>8) & 0xf);

View File

@ -23,8 +23,8 @@
void cbmem_run_init_hooks(int is_recovery) void cbmem_run_init_hooks(int is_recovery)
{ {
cbmem_init_hook_t *init_hook_ptr = (cbmem_init_hook_t*) &_cbmem_init_hooks; cbmem_init_hook_t *init_hook_ptr = (cbmem_init_hook_t *) &_cbmem_init_hooks;
cbmem_init_hook_t *einit_hook_ptr = (cbmem_init_hook_t*) &_ecbmem_init_hooks; cbmem_init_hook_t *einit_hook_ptr = (cbmem_init_hook_t *) &_ecbmem_init_hooks;
if (_cbmem_init_hooks_size == 0) if (_cbmem_init_hooks_size == 0)
return; return;

View File

@ -465,7 +465,7 @@ size_t write_coreboot_forwarding_table(uintptr_t entry, uintptr_t target)
(void *)entry); (void *)entry);
head = lb_table_init(entry); head = lb_table_init(entry);
lb_forward(head, (struct lb_header*)target); lb_forward(head, (struct lb_header *)target);
return (uintptr_t)lb_table_fini(head) - entry; return (uintptr_t)lb_table_fini(head) - entry;
} }

View File

@ -130,7 +130,7 @@ static void coverage_init(void *unused)
{ {
extern long __CTOR_LIST__; extern long __CTOR_LIST__;
typedef void (*func_ptr)(void) ; typedef void (*func_ptr)(void) ;
func_ptr *ctor = (func_ptr*) &__CTOR_LIST__; func_ptr *ctor = (func_ptr *) &__CTOR_LIST__;
if (ctor == NULL) if (ctor == NULL)
return; return;

View File

@ -973,8 +973,8 @@ __gcov_one_value_profiler (gcov_type *counters, gcov_type value)
/* Tries to determine the most common value among its inputs. */ /* Tries to determine the most common value among its inputs. */
void void
__gcov_indirect_call_profiler (gcov_type* counter, gcov_type value, __gcov_indirect_call_profiler (gcov_type *counter, gcov_type value,
void* cur_func, void* callee_func) void *cur_func, void *callee_func)
{ {
/* If the C++ virtual tables contain function descriptors then one /* If the C++ virtual tables contain function descriptors then one
function may have multiple descriptors and we need to dereference function may have multiple descriptors and we need to dereference

View File

@ -56,13 +56,13 @@ uint32_t tlcl_define_space(uint32_t index, uint32_t perm, uint32_t size)
return TPM_E_NO_DEVICE; return TPM_E_NO_DEVICE;
} }
uint32_t tlcl_write(uint32_t index, const void* data, uint32_t length) uint32_t tlcl_write(uint32_t index, const void *data, uint32_t length)
{ {
VBDEBUG("MOCK_TPM: %s\n", __func__); VBDEBUG("MOCK_TPM: %s\n", __func__);
return TPM_E_NO_DEVICE; return TPM_E_NO_DEVICE;
} }
uint32_t tlcl_read(uint32_t index, void* data, uint32_t length) uint32_t tlcl_read(uint32_t index, void *data, uint32_t length)
{ {
VBDEBUG("MOCK_TPM: %s\n", __func__); VBDEBUG("MOCK_TPM: %s\n", __func__);
return TPM_E_NO_DEVICE; return TPM_E_NO_DEVICE;
@ -105,13 +105,13 @@ uint32_t tlcl_set_deactivated(uint8_t flag)
return TPM_E_NO_DEVICE; return TPM_E_NO_DEVICE;
} }
uint32_t tlcl_get_permanent_flags(TPM_PERMANENT_FLAGS* pflags) uint32_t tlcl_get_permanent_flags(TPM_PERMANENT_FLAGS *pflags)
{ {
VBDEBUG("MOCK_TPM: %s\n", __func__); VBDEBUG("MOCK_TPM: %s\n", __func__);
return TPM_E_NO_DEVICE; return TPM_E_NO_DEVICE;
} }
uint32_t tlcl_get_flags(uint8_t* disable, uint8_t* deactivated, uint32_t tlcl_get_flags(uint8_t *disable, uint8_t *deactivated,
uint8_t *nvlocked) uint8_t *nvlocked)
{ {
VBDEBUG("MOCK_TPM: %s\n", __func__); VBDEBUG("MOCK_TPM: %s\n", __func__);
@ -124,8 +124,8 @@ uint32_t tlcl_set_global_lock(void)
return TPM_E_NO_DEVICE; return TPM_E_NO_DEVICE;
} }
uint32_t tlcl_extend(int pcr_num, const uint8_t* in_digest, 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__); VBDEBUG("MOCK_TPM: %s\n", __func__);
return TPM_E_NO_DEVICE; return TPM_E_NO_DEVICE;

View File

@ -399,7 +399,7 @@ static const struct reg_script_bus_entry
{ {
extern const struct reg_script_bus_entry *_rsbe_init_begin[]; extern const struct reg_script_bus_entry *_rsbe_init_begin[];
extern const struct reg_script_bus_entry *_ersbe_init_begin[]; extern const struct reg_script_bus_entry *_ersbe_init_begin[];
const struct reg_script_bus_entry * const * bus; const struct reg_script_bus_entry * const *bus;
size_t table_entries; size_t table_entries;
size_t i; size_t i;

View File

@ -465,7 +465,7 @@ static int load_self_segments(struct segment *head, struct prog *payload,
if ((unsigned long)end > bounce_buffer) { if ((unsigned long)end > bounce_buffer) {
if ((unsigned long)dest < bounce_buffer) { if ((unsigned long)dest < bounce_buffer) {
unsigned char *from = dest; unsigned char *from = dest;
unsigned char *to = (unsigned char*)(lb_start-(bounce_buffer-(unsigned long)dest)); unsigned char *to = (unsigned char *)(lb_start-(bounce_buffer-(unsigned long)dest));
unsigned long amount = bounce_buffer-(unsigned long)dest; unsigned long amount = bounce_buffer-(unsigned long)dest;
printk(BIOS_DEBUG, "move prefix around: from %p, to %p, amount: %lx\n", from, to, amount); printk(BIOS_DEBUG, "move prefix around: from %p, to %p, amount: %lx\n", from, to, amount);
memcpy(to, from, amount); memcpy(to, from, amount);
@ -475,7 +475,7 @@ static int load_self_segments(struct segment *head, struct prog *payload,
unsigned long to = lb_end; unsigned long to = lb_end;
unsigned long amount = (unsigned long)end - from; unsigned long amount = (unsigned long)end - from;
printk(BIOS_DEBUG, "move suffix around: from %lx, to %lx, amount: %lx\n", from, to, amount); printk(BIOS_DEBUG, "move suffix around: from %lx, to %lx, amount: %lx\n", from, to, amount);
memcpy((char*)to, (char*)from, amount); memcpy((char *)to, (char *)from, amount);
} }
} }

View File

@ -92,7 +92,7 @@ static struct timestamp_cache *timestamp_cache_get(void)
static struct timestamp_table *timestamp_alloc_cbmem_table(void) static struct timestamp_table *timestamp_alloc_cbmem_table(void)
{ {
struct timestamp_table* tst; struct timestamp_table *tst;
tst = cbmem_add(CBMEM_ID_TIMESTAMP, tst = cbmem_add(CBMEM_ID_TIMESTAMP,
sizeof(struct timestamp_table) + sizeof(struct timestamp_table) +

View File

@ -47,35 +47,35 @@ static int tpm_send_receive(const uint8_t *request,
} }
/* Sets the size field of a TPM command. */ /* Sets the size field of a TPM command. */
static inline void set_tpm_command_size(uint8_t* buffer, uint32_t size) { static inline void set_tpm_command_size(uint8_t *buffer, uint32_t size) {
to_tpm_uint32(buffer + sizeof(uint16_t), size); to_tpm_uint32(buffer + sizeof(uint16_t), size);
} }
/* Gets the size field of a TPM command. */ /* Gets the size field of a TPM command. */
__attribute__((unused)) __attribute__((unused))
static inline int tpm_command_size(const uint8_t* buffer) { static inline int tpm_command_size(const uint8_t *buffer) {
uint32_t size; uint32_t size;
from_tpm_uint32(buffer + sizeof(uint16_t), &size); from_tpm_uint32(buffer + sizeof(uint16_t), &size);
return (int) size; return (int) size;
} }
/* Gets the code field of a TPM command. */ /* Gets the code field of a TPM command. */
static inline int tpm_command_code(const uint8_t* buffer) { static inline int tpm_command_code(const uint8_t *buffer) {
uint32_t code; uint32_t code;
from_tpm_uint32(buffer + sizeof(uint16_t) + sizeof(uint32_t), &code); from_tpm_uint32(buffer + sizeof(uint16_t) + sizeof(uint32_t), &code);
return code; return code;
} }
/* Gets the return code field of a TPM result. */ /* Gets the return code field of a TPM result. */
static inline int tpm_return_code(const uint8_t* buffer) { static inline int tpm_return_code(const uint8_t *buffer) {
return tpm_command_code(buffer); return tpm_command_code(buffer);
} }
/* Like TlclSendReceive below, but do not retry if NEEDS_SELFTEST or /* Like TlclSendReceive below, but do not retry if NEEDS_SELFTEST or
* DOING_SELFTEST errors are returned. * DOING_SELFTEST errors are returned.
*/ */
static uint32_t tlcl_send_receive_no_retry(const uint8_t* request, static uint32_t tlcl_send_receive_no_retry(const uint8_t *request,
uint8_t* response, int max_length) { uint8_t *response, int max_length) {
uint32_t response_length = max_length; uint32_t response_length = max_length;
uint32_t result; uint32_t result;
@ -103,7 +103,7 @@ return result;
/* Sends a TPM command and gets a response. Returns 0 if success or the TPM /* Sends a TPM command and gets a response. Returns 0 if success or the TPM
* error code if error. Waits for the self test to complete if needed. */ * error code if error. Waits for the self test to complete if needed. */
uint32_t tlcl_send_receive(const uint8_t* request, uint8_t* response, uint32_t tlcl_send_receive(const uint8_t *request, uint8_t *response,
int max_length) { int max_length) {
uint32_t result = tlcl_send_receive_no_retry(request, response, uint32_t result = tlcl_send_receive_no_retry(request, response,
max_length); max_length);
@ -133,7 +133,7 @@ uint32_t tlcl_send_receive(const uint8_t* request, uint8_t* response,
} }
/* Sends a command and returns the error code. */ /* Sends a command and returns the error code. */
static uint32_t send(const uint8_t* command) { static uint32_t send(const uint8_t *command) {
uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE]; uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE];
return tlcl_send_receive(command, response, sizeof(response)); return tlcl_send_receive(command, response, sizeof(response));
} }
@ -193,7 +193,7 @@ uint32_t tlcl_define_space(uint32_t index, uint32_t perm, uint32_t size)
return send(cmd.buffer); return send(cmd.buffer);
} }
uint32_t tlcl_write(uint32_t index, const void* data, uint32_t length) uint32_t tlcl_write(uint32_t index, const void *data, uint32_t length)
{ {
struct s_tpm_nv_write_cmd cmd; struct s_tpm_nv_write_cmd cmd;
uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE]; uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE];
@ -212,7 +212,7 @@ uint32_t tlcl_write(uint32_t index, const void* data, uint32_t length)
return tlcl_send_receive(cmd.buffer, response, sizeof(response)); return tlcl_send_receive(cmd.buffer, response, sizeof(response));
} }
uint32_t tlcl_read(uint32_t index, void* data, uint32_t length) uint32_t tlcl_read(uint32_t index, void *data, uint32_t length)
{ {
struct s_tpm_nv_read_cmd cmd; struct s_tpm_nv_read_cmd cmd;
uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE]; uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE];
@ -226,7 +226,7 @@ uint32_t tlcl_read(uint32_t index, void* data, uint32_t length)
result = tlcl_send_receive(cmd.buffer, response, sizeof(response)); result = tlcl_send_receive(cmd.buffer, response, sizeof(response));
if (result == TPM_SUCCESS && length > 0) { if (result == TPM_SUCCESS && length > 0) {
uint8_t* nv_read_cursor = response + kTpmResponseHeaderLength; uint8_t *nv_read_cursor = response + kTpmResponseHeaderLength;
from_tpm_uint32(nv_read_cursor, &result_length); from_tpm_uint32(nv_read_cursor, &result_length);
nv_read_cursor += sizeof(uint32_t); nv_read_cursor += sizeof(uint32_t);
memcpy(data, nv_read_cursor, result_length); memcpy(data, nv_read_cursor, result_length);
@ -275,7 +275,7 @@ uint32_t tlcl_set_deactivated(uint8_t flag)
return send(cmd.buffer); return send(cmd.buffer);
} }
uint32_t tlcl_get_permanent_flags(TPM_PERMANENT_FLAGS* pflags) uint32_t tlcl_get_permanent_flags(TPM_PERMANENT_FLAGS *pflags)
{ {
uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE]; uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE];
uint32_t size; uint32_t size;
@ -290,7 +290,7 @@ uint32_t tlcl_get_permanent_flags(TPM_PERMANENT_FLAGS* pflags)
return result; return result;
} }
uint32_t tlcl_get_flags(uint8_t* disable, uint8_t* deactivated, uint32_t tlcl_get_flags(uint8_t *disable, uint8_t *deactivated,
uint8_t *nvlocked) uint8_t *nvlocked)
{ {
TPM_PERMANENT_FLAGS pflags; TPM_PERMANENT_FLAGS pflags;
@ -312,11 +312,11 @@ uint32_t tlcl_set_global_lock(void)
{ {
uint32_t x; uint32_t x;
VBDEBUG("TPM: Set global lock\n"); VBDEBUG("TPM: Set global lock\n");
return tlcl_write(TPM_NV_INDEX0, (uint8_t*) &x, 0); return tlcl_write(TPM_NV_INDEX0, (uint8_t *) &x, 0);
} }
uint32_t tlcl_extend(int pcr_num, const uint8_t* in_digest, uint32_t tlcl_extend(int pcr_num, const uint8_t *in_digest,
uint8_t* out_digest) uint8_t *out_digest)
{ {
struct s_tpm_extend_cmd cmd; struct s_tpm_extend_cmd cmd;
uint8_t response[kTpmResponseHeaderLength + kPcrDigestLength]; uint8_t response[kTpmResponseHeaderLength + kPcrDigestLength];