From b2d834a93afe129851f9aa7400f3fb2f42be20a4 Mon Sep 17 00:00:00 2001 From: Lee Leahy Date: Wed, 8 Mar 2017 16:52:22 -0800 Subject: src/lib: Fix space between type, * and variable name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://review.coreboot.org/18696 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Arthur Heymans --- src/lib/cbfs.c | 2 +- src/lib/cbmem_common.c | 4 ++-- src/lib/coreboot_table.c | 2 +- src/lib/gcov-glue.c | 2 +- src/lib/libgcov.c | 4 ++-- src/lib/mocked_tlcl.c | 12 ++++++------ src/lib/reg_script.c | 2 +- src/lib/selfboot.c | 4 ++-- src/lib/timestamp.c | 2 +- src/lib/tlcl.c | 32 ++++++++++++++++---------------- 10 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index ff166d8793..11bce2c530 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -146,7 +146,7 @@ static inline int tohex4(unsigned int c) 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[1] = tohex4((val>>8) & 0xf); diff --git a/src/lib/cbmem_common.c b/src/lib/cbmem_common.c index 2a057d6ba4..16050e0cdf 100644 --- a/src/lib/cbmem_common.c +++ b/src/lib/cbmem_common.c @@ -23,8 +23,8 @@ 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 *einit_hook_ptr = (cbmem_init_hook_t*) &_ecbmem_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; if (_cbmem_init_hooks_size == 0) return; diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c index 32201c099c..59f061b88f 100644 --- a/src/lib/coreboot_table.c +++ b/src/lib/coreboot_table.c @@ -465,7 +465,7 @@ size_t write_coreboot_forwarding_table(uintptr_t entry, uintptr_t target) (void *)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; } diff --git a/src/lib/gcov-glue.c b/src/lib/gcov-glue.c index 5c18581dec..d200cd2d98 100644 --- a/src/lib/gcov-glue.c +++ b/src/lib/gcov-glue.c @@ -130,7 +130,7 @@ static void coverage_init(void *unused) { extern long __CTOR_LIST__; typedef void (*func_ptr)(void) ; - func_ptr *ctor = (func_ptr*) &__CTOR_LIST__; + func_ptr *ctor = (func_ptr *) &__CTOR_LIST__; if (ctor == NULL) return; diff --git a/src/lib/libgcov.c b/src/lib/libgcov.c index 855b83aa31..488eb45571 100644 --- a/src/lib/libgcov.c +++ b/src/lib/libgcov.c @@ -973,8 +973,8 @@ __gcov_one_value_profiler (gcov_type *counters, gcov_type value) /* Tries to determine the most common value among its inputs. */ void -__gcov_indirect_call_profiler (gcov_type* counter, gcov_type value, - void* cur_func, void* callee_func) +__gcov_indirect_call_profiler (gcov_type *counter, gcov_type value, + void *cur_func, void *callee_func) { /* If the C++ virtual tables contain function descriptors then one function may have multiple descriptors and we need to dereference diff --git a/src/lib/mocked_tlcl.c b/src/lib/mocked_tlcl.c index 8dfcfabd6c..d6bcc9f950 100644 --- a/src/lib/mocked_tlcl.c +++ b/src/lib/mocked_tlcl.c @@ -56,13 +56,13 @@ uint32_t tlcl_define_space(uint32_t index, uint32_t perm, uint32_t size) 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__); 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__); return TPM_E_NO_DEVICE; @@ -105,13 +105,13 @@ uint32_t tlcl_set_deactivated(uint8_t flag) 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__); 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) { VBDEBUG("MOCK_TPM: %s\n", __func__); @@ -124,8 +124,8 @@ uint32_t tlcl_set_global_lock(void) return TPM_E_NO_DEVICE; } -uint32_t tlcl_extend(int pcr_num, const uint8_t* in_digest, - uint8_t* out_digest) +uint32_t tlcl_extend(int pcr_num, const uint8_t *in_digest, + uint8_t *out_digest) { VBDEBUG("MOCK_TPM: %s\n", __func__); return TPM_E_NO_DEVICE; diff --git a/src/lib/reg_script.c b/src/lib/reg_script.c index 16efa36c5d..b63a05b248 100644 --- a/src/lib/reg_script.c +++ b/src/lib/reg_script.c @@ -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 *_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 i; diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c index 162a03443c..0746cb9011 100644 --- a/src/lib/selfboot.c +++ b/src/lib/selfboot.c @@ -465,7 +465,7 @@ static int load_self_segments(struct segment *head, struct prog *payload, if ((unsigned long)end > bounce_buffer) { if ((unsigned long)dest < bounce_buffer) { 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; printk(BIOS_DEBUG, "move prefix around: from %p, to %p, amount: %lx\n", from, to, 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 amount = (unsigned long)end - from; 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); } } diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c index 2f2a5d8752..5f84cf4ac8 100644 --- a/src/lib/timestamp.c +++ b/src/lib/timestamp.c @@ -92,7 +92,7 @@ static struct timestamp_cache *timestamp_cache_get(void) static struct timestamp_table *timestamp_alloc_cbmem_table(void) { - struct timestamp_table* tst; + struct timestamp_table *tst; tst = cbmem_add(CBMEM_ID_TIMESTAMP, sizeof(struct timestamp_table) + diff --git a/src/lib/tlcl.c b/src/lib/tlcl.c index 0a4706b164..a15126e934 100644 --- a/src/lib/tlcl.c +++ b/src/lib/tlcl.c @@ -47,35 +47,35 @@ static int tpm_send_receive(const uint8_t *request, } /* 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); } /* Gets the size field of a TPM command. */ __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; from_tpm_uint32(buffer + sizeof(uint16_t), &size); return (int) size; } /* 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; from_tpm_uint32(buffer + sizeof(uint16_t) + sizeof(uint32_t), &code); return code; } /* 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); } /* Like TlclSendReceive below, but do not retry if NEEDS_SELFTEST or * DOING_SELFTEST errors are returned. */ -static uint32_t tlcl_send_receive_no_retry(const uint8_t* request, - uint8_t* response, int max_length) { +static uint32_t tlcl_send_receive_no_retry(const uint8_t *request, + uint8_t *response, int max_length) { uint32_t response_length = max_length; uint32_t result; @@ -103,7 +103,7 @@ return result; /* 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. */ -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) { uint32_t result = tlcl_send_receive_no_retry(request, response, 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. */ -static uint32_t send(const uint8_t* command) { +static uint32_t send(const uint8_t *command) { uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE]; 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); } -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; 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)); } -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; 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)); 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); nv_read_cursor += sizeof(uint32_t); memcpy(data, nv_read_cursor, result_length); @@ -275,7 +275,7 @@ uint32_t tlcl_set_deactivated(uint8_t flag) 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]; uint32_t size; @@ -290,7 +290,7 @@ uint32_t tlcl_get_permanent_flags(TPM_PERMANENT_FLAGS* pflags) 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) { TPM_PERMANENT_FLAGS pflags; @@ -312,11 +312,11 @@ uint32_t tlcl_set_global_lock(void) { uint32_t x; 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, - uint8_t* out_digest) +uint32_t tlcl_extend(int pcr_num, const uint8_t *in_digest, + uint8_t *out_digest) { struct s_tpm_extend_cmd cmd; uint8_t response[kTpmResponseHeaderLength + kPcrDigestLength]; -- cgit v1.2.3