Bluetooth: Controller: Fix coding style in ctrl.c, util/ and main.c

Initial sweep of controller code to fix the coding style.

Change-Id: Ib71c5a4657a1f162273f2dcd485fe70fff934928
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2016-08-25 10:30:54 +03:00
commit 2599974189
3 changed files with 1341 additions and 1603 deletions

File diff suppressed because it is too large Load diff

View file

@ -56,12 +56,10 @@
#define HCI_EVT 0x04
static uint8_t ALIGNED(4) _rand_context[3 + 4 + 1];
static uint8_t ALIGNED(4) _ticker_nodes[RADIO_TICKER_NODES]
[TICKER_NODE_T_SIZE];
static uint8_t ALIGNED(4) _ticker_users[RADIO_TICKER_USERS]
[TICKER_USER_T_SIZE];
static uint8_t ALIGNED(4) _ticker_nodes[RADIO_TICKER_NODES][TICKER_NODE_T_SIZE];
static uint8_t ALIGNED(4) _ticker_users[RADIO_TICKER_USERS][TICKER_USER_T_SIZE];
static uint8_t ALIGNED(4) _ticker_user_ops[RADIO_TICKER_USER_OPS]
[TICKER_USER_OP_T_SIZE];
[TICKER_USER_OP_T_SIZE];
static uint8_t ALIGNED(4) _radio[LL_MEM_TOTAL];
static struct nano_sem nano_sem_native_recv;
@ -218,9 +216,8 @@ static void native_recv_fiber(int unused0, int unused1)
uint8_t num_cmplt;
struct radio_pdu_node_rx *radio_pdu_node_rx;
while (
(num_cmplt =
radio_rx_get(&radio_pdu_node_rx, &handle))) {
while ((num_cmplt =
radio_rx_get(&radio_pdu_node_rx, &handle))) {
uint8_t len;
uint8_t *buf;
int retval;

View file

@ -59,7 +59,7 @@ void *mem_acquire(void **mem_head)
free_count--;
mem = *mem_head;
memcpy((void *)mem_head, mem, sizeof(mem_head));
memcpy(mem_head, mem, sizeof(mem_head));
/* Store free mem_count after the list's next pointer */
if (*mem_head) {
@ -70,7 +70,7 @@ void *mem_acquire(void **mem_head)
return mem;
}
return (void *)0;
return NULL;
}
void mem_release(void *mem, void **mem_head)
@ -79,13 +79,12 @@ void mem_release(void *mem, void **mem_head)
/* Get the free count from the list and increment it */
if (*mem_head) {
memcpy((void *)&free_count,
((uint8_t *)*mem_head + sizeof(mem_head)),
sizeof(free_count));
memcpy(&free_count, ((uint8_t *)*mem_head + sizeof(mem_head)),
sizeof(free_count));
}
free_count++;
memcpy(mem, (void *)mem_head, sizeof(mem));
memcpy(mem, mem_head, sizeof(mem));
*mem_head = mem;
/* Store free mem_count after the list's next pointer */
@ -99,9 +98,8 @@ uint16_t mem_free_count_get(void *mem_head)
/* Get the free count from the list */
if (mem_head) {
memcpy((void *)&free_count,
((uint8_t *)mem_head + sizeof(mem_head)),
sizeof(free_count));
memcpy(&free_count, ((uint8_t *)mem_head + sizeof(mem_head)),
sizeof(free_count));
}
return free_count;
@ -147,7 +145,7 @@ uint32_t mem_ut(void)
uint16_t mem_free_count;
void *mem;
mem_init(pool, BLOCK_SIZE, BLOCK_COUNT, (void **)&mem_free);
mem_init(pool, BLOCK_SIZE, BLOCK_COUNT, &mem_free);
mem_free_count = mem_free_count_get(mem_free);
if (mem_free_count != BLOCK_COUNT) {
@ -164,7 +162,7 @@ uint32_t mem_ut(void)
return 2;
}
memcpy(mem, (uint8_t *)&mem_used, sizeof(mem));
memcpy(mem, &mem_used, sizeof(mem));
mem_used = mem;
}
@ -177,7 +175,7 @@ uint32_t mem_ut(void)
uint16_t mem_free_count_current;
mem = mem_used;
memcpy((uint8_t *)&mem_used, mem, sizeof(void *));
memcpy(&mem_used, mem, sizeof(void *));
mem_release(mem, &mem_free);
mem_free_count_current = mem_free_count_get(mem_free);