Bluetooth: Controller: Fix coding style, use of (void)
Remove use of (void) before unused functions return values. Replace use of (void) with ARG_UNUSED for unused parameters. Change-id: I9ffea666f10dbdc01710df723e0df253a1cdd6e6 Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
This commit is contained in:
parent
eb443ddffc
commit
22e3f62e07
3 changed files with 80 additions and 86 deletions
|
@ -2474,8 +2474,8 @@ static void isr(void)
|
|||
#if (WORK_TICKER_WORKER0_IRQ_PRIORITY == WORK_TICKER_JOB0_IRQ_PRIORITY)
|
||||
static void ticker_job_disable(uint32_t status, void *op_context)
|
||||
{
|
||||
(void)status;
|
||||
(void)op_context;
|
||||
ARG_UNUSED(status);
|
||||
ARG_UNUSED(op_context);
|
||||
|
||||
if (_radio.state != STATE_NONE) {
|
||||
work_disable(WORK_TICKER_JOB0_IRQ);
|
||||
|
@ -2490,7 +2490,7 @@ static void ticker_if_done(uint32_t status, void *ops_context)
|
|||
|
||||
static void ticker_success_assert(uint32_t status, void *params)
|
||||
{
|
||||
(void)params;
|
||||
ARG_UNUSED(params);
|
||||
|
||||
ASSERT(status == TICKER_STATUS_SUCCESS);
|
||||
}
|
||||
|
@ -2528,10 +2528,10 @@ static void event_active(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
(void *)1 };
|
||||
uint32_t retval;
|
||||
|
||||
(void)ticks_at_expire;
|
||||
(void)remainder;
|
||||
(void)lazy;
|
||||
(void)context;
|
||||
ARG_UNUSED(ticks_at_expire);
|
||||
ARG_UNUSED(remainder);
|
||||
ARG_UNUSED(lazy);
|
||||
ARG_UNUSED(context);
|
||||
|
||||
retval = work_schedule(&s_work_radio_active, 0);
|
||||
ASSERT(!retval);
|
||||
|
@ -2539,7 +2539,7 @@ static void event_active(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
|
||||
static void work_radio_deassert(void *params)
|
||||
{
|
||||
(void)params;
|
||||
ARG_UNUSED(params);
|
||||
|
||||
work_radio_active(0);
|
||||
|
||||
|
@ -2548,9 +2548,9 @@ static void work_radio_deassert(void *params)
|
|||
|
||||
static void work_xtal_start(void *params)
|
||||
{
|
||||
(void)params;
|
||||
ARG_UNUSED(params);
|
||||
|
||||
(void)clock_m16src_start(1);
|
||||
clock_m16src_start(1);
|
||||
}
|
||||
|
||||
static void event_xtal(uint32_t ticks_at_expire, uint32_t remainder,
|
||||
|
@ -2560,10 +2560,10 @@ static void event_xtal(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
WORK_TICKER_WORKER0_IRQ, (work_fp) work_xtal_start, 0 };
|
||||
uint32_t retval;
|
||||
|
||||
(void)ticks_at_expire;
|
||||
(void)remainder;
|
||||
(void)lazy;
|
||||
(void)context;
|
||||
ARG_UNUSED(ticks_at_expire);
|
||||
ARG_UNUSED(remainder);
|
||||
ARG_UNUSED(lazy);
|
||||
ARG_UNUSED(context);
|
||||
|
||||
retval = work_schedule(&s_work_xtal_start, 0);
|
||||
ASSERT(!retval);
|
||||
|
@ -2571,7 +2571,7 @@ static void event_xtal(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
|
||||
static void work_xtal_stop(void *params)
|
||||
{
|
||||
(void)params;
|
||||
ARG_UNUSED(params);
|
||||
|
||||
clock_m16src_stop();
|
||||
|
||||
|
@ -2834,7 +2834,7 @@ static void work_xtal_stop_calc(void *params)
|
|||
status = conn_update_req(conn_curr);
|
||||
if ((status == 2) &&
|
||||
(conn->llcp_version.rx)) {
|
||||
(void)conn_update_req(conn);
|
||||
conn_update_req(conn);
|
||||
}
|
||||
} else if ((conn_curr->role.master.role == 0) &&
|
||||
(conn->role.slave.role != 0) &&
|
||||
|
@ -2847,7 +2847,7 @@ static void work_xtal_stop_calc(void *params)
|
|||
status = conn_update_req(conn);
|
||||
if ((status == 2) &&
|
||||
(conn_curr->llcp_version.rx)) {
|
||||
(void)conn_update_req(conn_curr);
|
||||
conn_update_req(conn_curr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3312,9 +3312,9 @@ static void event_stop(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
WORK_TICKER_WORKER0_IRQ, (work_fp) work_radio_stop, 0 };
|
||||
uint32_t retval;
|
||||
|
||||
(void)ticks_at_expire;
|
||||
(void)remainder;
|
||||
(void)lazy;
|
||||
ARG_UNUSED(ticks_at_expire);
|
||||
ARG_UNUSED(remainder);
|
||||
ARG_UNUSED(lazy);
|
||||
|
||||
/* Radio state requested (stop or abort) stored in context is supplied
|
||||
* in params.
|
||||
|
@ -3365,11 +3365,11 @@ static void event_common_prepare(uint32_t ticks_at_expire,
|
|||
ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
|
||||
(ticker_status == TICKER_STATUS_BUSY));
|
||||
|
||||
(void)event_xtal(0, 0, 0, 0);
|
||||
event_xtal(0, 0, 0, 0);
|
||||
} else if (_ticks_active_to_start > _ticks_xtal_to_start) {
|
||||
ticks_to_start = _ticks_active_to_start;
|
||||
|
||||
(void)event_active(0, 0, 0, 0);
|
||||
event_active(0, 0, 0, 0);
|
||||
|
||||
ticker_status = ticker_start(RADIO_TICKER_INSTANCE_ID_RADIO,
|
||||
RADIO_TICKER_USER_ID_WORKER,
|
||||
|
@ -3384,8 +3384,8 @@ static void event_common_prepare(uint32_t ticks_at_expire,
|
|||
} else {
|
||||
ticks_to_start = _ticks_xtal_to_start;
|
||||
|
||||
(void)event_active(0, 0, 0, 0);
|
||||
(void)event_xtal(0, 0, 0, 0);
|
||||
event_active(0, 0, 0, 0);
|
||||
event_xtal(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/* remember the remainder to be used in pkticker */
|
||||
|
@ -3644,8 +3644,8 @@ static void adv_obs_configure(uint8_t phy)
|
|||
void radio_event_adv_prepare(uint32_t ticks_at_expire, uint32_t remainder,
|
||||
uint16_t lazy, void *context)
|
||||
{
|
||||
(void)lazy;
|
||||
(void)context;
|
||||
ARG_UNUSED(lazy);
|
||||
ARG_UNUSED(context);
|
||||
|
||||
DEBUG_RADIO_PREPARE_A(1);
|
||||
|
||||
|
@ -3696,9 +3696,9 @@ static void adv_setup(void)
|
|||
static void event_adv(uint32_t ticks_at_expire, uint32_t remainder,
|
||||
uint16_t lazy, void *context)
|
||||
{
|
||||
(void)remainder;
|
||||
(void)lazy;
|
||||
(void)context;
|
||||
ARG_UNUSED(remainder);
|
||||
ARG_UNUSED(lazy);
|
||||
ARG_UNUSED(context);
|
||||
|
||||
DEBUG_RADIO_START_A(1);
|
||||
|
||||
|
@ -3768,10 +3768,10 @@ void event_adv_stop(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
struct pdu_data *pdu_data_rx;
|
||||
struct radio_le_conn_cmplt *radio_le_conn_cmplt;
|
||||
|
||||
(void)ticks_at_expire;
|
||||
(void)remainder;
|
||||
(void)lazy;
|
||||
(void)context;
|
||||
ARG_UNUSED(ticks_at_expire);
|
||||
ARG_UNUSED(remainder);
|
||||
ARG_UNUSED(lazy);
|
||||
ARG_UNUSED(context);
|
||||
|
||||
/* Stop Direct Adv */
|
||||
ticker_status =
|
||||
|
@ -3819,8 +3819,8 @@ void event_adv_stop(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
static void event_obs_prepare(uint32_t ticks_at_expire, uint32_t remainder,
|
||||
uint16_t lazy, void *context)
|
||||
{
|
||||
(void)lazy;
|
||||
(void)context;
|
||||
ARG_UNUSED(lazy);
|
||||
ARG_UNUSED(context);
|
||||
|
||||
DEBUG_RADIO_PREPARE_O(1);
|
||||
|
||||
|
@ -3873,9 +3873,9 @@ static void event_obs(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
{
|
||||
uint32_t ticker_status;
|
||||
|
||||
(void)remainder;
|
||||
(void)lazy;
|
||||
(void)context;
|
||||
ARG_UNUSED(remainder);
|
||||
ARG_UNUSED(lazy);
|
||||
ARG_UNUSED(context);
|
||||
|
||||
DEBUG_RADIO_START_O(1);
|
||||
|
||||
|
@ -4350,7 +4350,7 @@ static inline uint32_t event_conn_update_prep(struct connection *conn,
|
|||
conn->role.slave.window_widening_periodic_us;
|
||||
|
||||
if (conn->llcp.connection_update.is_internal == 2) {
|
||||
(void)conn_update_req(conn);
|
||||
conn_update_req(conn);
|
||||
}
|
||||
} else {
|
||||
ticks_win_offset =
|
||||
|
@ -5056,8 +5056,8 @@ static void event_slave(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
uint8_t data_channel_use;
|
||||
uint32_t remainder_us;
|
||||
|
||||
(void)remainder;
|
||||
(void)lazy;
|
||||
ARG_UNUSED(remainder);
|
||||
ARG_UNUSED(lazy);
|
||||
|
||||
DEBUG_RADIO_START_S(1);
|
||||
|
||||
|
@ -5171,8 +5171,8 @@ static void event_master(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
struct pdu_data *pdu_data_tx;
|
||||
uint8_t data_channel_use;
|
||||
|
||||
(void)remainder;
|
||||
(void)lazy;
|
||||
ARG_UNUSED(remainder);
|
||||
ARG_UNUSED(lazy);
|
||||
|
||||
DEBUG_RADIO_START_M(1);
|
||||
|
||||
|
@ -6684,7 +6684,7 @@ uint32_t radio_connect_enable(uint8_t adv_addr_type, uint8_t *adv_addr,
|
|||
return 1;
|
||||
}
|
||||
|
||||
(void)radio_scan_disable();
|
||||
radio_scan_disable();
|
||||
|
||||
_radio.observer.adv_addr_type = adv_addr_type;
|
||||
memcpy(&_radio.observer.adv_addr[0], adv_addr, BDADDR_SIZE);
|
||||
|
@ -6796,7 +6796,7 @@ uint32_t radio_conn_update(uint16_t handle, uint8_t cmd, uint8_t status,
|
|||
{
|
||||
struct connection *conn;
|
||||
|
||||
(void)status;
|
||||
ARG_UNUSED(status);
|
||||
|
||||
conn = connection_get(handle);
|
||||
if ((!conn) ||
|
||||
|
|
|
@ -40,8 +40,8 @@ typedef void (*ticker_fp_compare_set) (uint32_t cc);
|
|||
struct ticker_node {
|
||||
uint8_t next;
|
||||
|
||||
uint8_t is_sched_req;
|
||||
uint8_t is_sched_ack;
|
||||
uint8_t req;
|
||||
uint8_t ack;
|
||||
uint8_t force;
|
||||
uint32_t ticks_periodic;
|
||||
uint32_t ticks_to_expire;
|
||||
|
@ -387,25 +387,24 @@ static inline void ticker_worker(struct ticker_instance *instance)
|
|||
/* move to next ticker */
|
||||
ticker_id_head = ticker->next;
|
||||
|
||||
/* execute Task */
|
||||
if (((ticker->is_sched_req - ticker->is_sched_ack) & 0xFF) ==
|
||||
1) {
|
||||
/* scheduled timeout is acknowledged to be complete */
|
||||
ticker->is_sched_ack--;
|
||||
/* skip if not scheduled to execute */
|
||||
if (((ticker->req - ticker->ack) & 0xff) != 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ticker->timeout_func) {
|
||||
DEBUG_TICKER_TASK(1);
|
||||
(void)ticker->
|
||||
timeout_func(((instance->ticks_current +
|
||||
ticks_expired -
|
||||
ticker->
|
||||
ticks_to_expire_minus) &
|
||||
0x00FFFFFF),
|
||||
ticker->remainder_current,
|
||||
ticker->lazy_current,
|
||||
ticker->context);
|
||||
DEBUG_TICKER_TASK(0);
|
||||
}
|
||||
/* scheduled timeout is acknowledged to be complete */
|
||||
ticker->ack--;
|
||||
|
||||
if (ticker->timeout_func) {
|
||||
DEBUG_TICKER_TASK(1);
|
||||
ticker->timeout_func(((instance->ticks_current +
|
||||
ticks_expired -
|
||||
ticker->ticks_to_expire_minus) &
|
||||
0x00FFFFFF),
|
||||
ticker->remainder_current,
|
||||
ticker->lazy_current,
|
||||
ticker->context);
|
||||
DEBUG_TICKER_TASK(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -600,9 +599,7 @@ static inline uint8_t ticker_job_list_manage(
|
|||
}
|
||||
|
||||
/* determine the ticker state */
|
||||
state =
|
||||
(ticker->is_sched_req -
|
||||
ticker->is_sched_ack) & 0xFF;
|
||||
state = (ticker->req - ticker->ack) & 0xff;
|
||||
|
||||
/* if not started or update not required,
|
||||
* set status and continue.
|
||||
|
@ -655,11 +652,10 @@ static inline uint8_t ticker_job_list_manage(
|
|||
/* set schedule status of node
|
||||
* as updating.
|
||||
*/
|
||||
ticker->is_sched_req++;
|
||||
ticker->req++;
|
||||
} else {
|
||||
/* reset schedule status of node */
|
||||
ticker->is_sched_req =
|
||||
ticker->is_sched_ack;
|
||||
ticker->req = ticker->ack;
|
||||
|
||||
if (instance->
|
||||
ticker_id_slot_previous ==
|
||||
|
@ -782,10 +778,10 @@ static inline void ticker_job_worker_bottom_half(
|
|||
*insert_head = id_expired;
|
||||
|
||||
/* set schedule status of node as restarting. */
|
||||
ticker->is_sched_req++;
|
||||
ticker->req++;
|
||||
} else {
|
||||
/* reset schedule status of node */
|
||||
ticker->is_sched_req = ticker->is_sched_ack;
|
||||
ticker->req = ticker->ack;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -841,8 +837,7 @@ static inline void ticker_job_list_insert(
|
|||
continue;
|
||||
}
|
||||
|
||||
if (((ticker->is_sched_req -
|
||||
ticker->is_sched_ack) & 0xFF) != 0) {
|
||||
if (((ticker->req - ticker->ack) & 0xff) != 0) {
|
||||
user_op->op = TICKER_USER_OP_TYPE_NONE;
|
||||
user_op->status =
|
||||
TICKER_STATUS_FAILURE;
|
||||
|
@ -909,8 +904,8 @@ static inline void ticker_job_list_insert(
|
|||
id_collide);
|
||||
|
||||
/* unschedule node */
|
||||
ticker_preempt->is_sched_req =
|
||||
ticker_preempt->is_sched_ack;
|
||||
ticker_preempt->req =
|
||||
ticker_preempt->ack;
|
||||
|
||||
/* enqueue for re-insertion */
|
||||
ticker_preempt->next = insert_head;
|
||||
|
@ -928,8 +923,7 @@ static inline void ticker_job_list_insert(
|
|||
|
||||
/* Update flags */
|
||||
if (id_insert == id_collide) {
|
||||
ticker->is_sched_req =
|
||||
ticker->is_sched_ack + 1;
|
||||
ticker->req = ticker->ack + 1;
|
||||
|
||||
status = TICKER_STATUS_SUCCESS;
|
||||
} else {
|
||||
|
@ -1190,7 +1184,7 @@ static void ticker_instance0_worker_sched(uint8_t chain)
|
|||
* before being actually needing the work to complete before new
|
||||
* schedule.
|
||||
*/
|
||||
(void)work_schedule(&instance0_worker_irq, chain);
|
||||
work_schedule(&instance0_worker_irq, chain);
|
||||
}
|
||||
|
||||
static void ticker_instance0_job_sched(uint8_t chain)
|
||||
|
@ -1204,12 +1198,12 @@ static void ticker_instance0_job_sched(uint8_t chain)
|
|||
* before being actually needing the work to complete before new
|
||||
* schedule.
|
||||
*/
|
||||
(void)work_schedule(&instance0_job_irq, chain);
|
||||
work_schedule(&instance0_job_irq, chain);
|
||||
}
|
||||
|
||||
static void ticker_instance0_rtc_compare_set(uint32_t value)
|
||||
{
|
||||
(void)rtc_compare_set(0, value);
|
||||
rtc_compare_set(0, value);
|
||||
}
|
||||
|
||||
static void ticker_instance1_worker_sched(uint8_t chain)
|
||||
|
@ -1223,7 +1217,7 @@ static void ticker_instance1_worker_sched(uint8_t chain)
|
|||
* before being actually needing the work to complete before new
|
||||
* schedule.
|
||||
*/
|
||||
(void)work_schedule(&instance1_worker_irq, chain);
|
||||
work_schedule(&instance1_worker_irq, chain);
|
||||
}
|
||||
|
||||
static void ticker_instance1_job_sched(uint8_t chain)
|
||||
|
@ -1237,12 +1231,12 @@ static void ticker_instance1_job_sched(uint8_t chain)
|
|||
* before being actually needing the work to complete before new
|
||||
* schedule.
|
||||
*/
|
||||
(void)work_schedule(&instance1_job_irq, chain);
|
||||
work_schedule(&instance1_job_irq, chain);
|
||||
}
|
||||
|
||||
static void ticker_instance1_rtc_compare_set(uint32_t value)
|
||||
{
|
||||
(void)rtc_compare_set(1, value);
|
||||
rtc_compare_set(1, value);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
|
@ -318,7 +318,7 @@ static int native_open(void)
|
|||
{
|
||||
uint32_t retval;
|
||||
|
||||
(void)clock_k32src_start(1);
|
||||
clock_k32src_start(1);
|
||||
|
||||
_ticker_users[RADIO_TICKER_USER_ID_WORKER][0] =
|
||||
RADIO_TICKER_USER_WORKER_OPS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue