diff --git a/framework/src/fwk_dlist.c b/framework/src/fwk_dlist.c index 5af1ae23a400ed6a71920a225baf38b8e83c3b1c..036396a03c8307abe3fe326a10babb049358559f 100644 --- a/framework/src/fwk_dlist.c +++ b/framework/src/fwk_dlist.c @@ -72,7 +72,7 @@ void __fwk_dlist_remove( fwk_assert(node->prev != NULL); fwk_assert(node->next != NULL); - assert(__fwk_slist_contains( + fwk_assert(__fwk_slist_contains( (struct fwk_slist *)list, (struct fwk_slist_node *)node)); @@ -103,7 +103,7 @@ void __fwk_dlist_insert( fwk_assert(node->prev != NULL); fwk_assert(node->next != NULL); - assert(__fwk_slist_contains( + fwk_assert(__fwk_slist_contains( (struct fwk_slist *)list, (struct fwk_slist_node *)node)); diff --git a/framework/src/fwk_id.c b/framework/src/fwk_id.c index 820105b342f4f40bf79996bf934e8a32c140a917..99d1e866ace8bbcd8a29ba69c3effd8b53001f01 100644 --- a/framework/src/fwk_id.c +++ b/framework/src/fwk_id.c @@ -231,8 +231,8 @@ unsigned int fwk_id_get_module_idx(fwk_id_t id) unsigned int fwk_id_get_element_idx(fwk_id_t element_id) { - assert((element_id.common.type == __FWK_ID_TYPE_ELEMENT) || - (element_id.common.type == __FWK_ID_TYPE_SUB_ELEMENT)); + fwk_assert((element_id.common.type == __FWK_ID_TYPE_ELEMENT) || + (element_id.common.type == __FWK_ID_TYPE_SUB_ELEMENT)); return element_id.element.element_idx; } diff --git a/framework/src/fwk_thread.c b/framework/src/fwk_thread.c index e3bed4528ec32c141f6afea653127a4d36aae5a1..a2f716985d262deb84bdd42b312b2aad3cad5fd6 100644 --- a/framework/src/fwk_thread.c +++ b/framework/src/fwk_thread.c @@ -218,7 +218,6 @@ static void process_next_event(void) ctx.current_event = NULL; free_event(event); - return; } static bool process_isr(void) diff --git a/module/apcontext/src/mod_apcontext.c b/module/apcontext/src/mod_apcontext.c index ad5e3918153a3c29dee5b22e65fdc3d8994c2e20..9dd92585ae7c135aa800215766e3a205445d97d4 100644 --- a/module/apcontext/src/mod_apcontext.c +++ b/module/apcontext/src/mod_apcontext.c @@ -85,7 +85,7 @@ static int apcontext_process_notification(const struct fwk_event *event, fwk_id_is_equal(event->id, mod_clock_notification_id_state_changed)); fwk_assert(fwk_id_is_type(event->target_id, FWK_ID_TYPE_MODULE)); - params = (struct clock_notification_params *)event->params; + params = (struct clock_notification_params *)(void *)event->params; /* * Zero AP context area when the system is initialized for the first time diff --git a/module/clock/src/mod_clock.c b/module/clock/src/mod_clock.c index cecafc1180b8665917d467508dc1a904a95a363a..cd489f340cfc1954bf0a66006a739bc925ae29e7 100644 --- a/module/clock/src/mod_clock.c +++ b/module/clock/src/mod_clock.c @@ -68,9 +68,9 @@ static int process_response_event(const struct fwk_event *event) struct fwk_event resp_event; struct clock_dev_ctx *ctx; struct mod_clock_driver_resp_params *event_params = - (struct mod_clock_driver_resp_params *)event->params; + (struct mod_clock_driver_resp_params *)(void *)event->params; struct mod_clock_resp_params *resp_params = - (struct mod_clock_resp_params *)resp_event.params; + (struct mod_clock_resp_params *)(void *)resp_event.params; ctx = &module_ctx.dev_ctx_table[fwk_id_get_element_idx(event->target_id)]; @@ -138,14 +138,14 @@ static void get_ctx(fwk_id_t clock_id, struct clock_dev_ctx **ctx) * Driver response API. */ -void request_complete(fwk_id_t dev_id, - struct mod_clock_driver_resp_params *response) +static void request_complete(fwk_id_t dev_id, + struct mod_clock_driver_resp_params *response) { int status; struct fwk_event event; struct clock_dev_ctx *ctx; struct mod_clock_driver_resp_params *event_params = - (struct mod_clock_driver_resp_params *)event.params; + (struct mod_clock_driver_resp_params *)(void *)event.params; fwk_assert(fwk_module_is_valid_element_id(dev_id)); @@ -448,10 +448,10 @@ static int clock_process_pd_pre_transition_notification( }; pd_params = (struct mod_pd_power_state_pre_transition_notification_params *) - event->params; + (void *)event->params; pd_resp_params = (struct mod_pd_power_state_pre_transition_notification_resp_params *) - resp_event->params; + (void *)resp_event->params; fwk_assert(ctx->api->process_pending_power_transition != NULL); status = ctx->api->process_pending_power_transition( @@ -472,7 +472,7 @@ static int clock_process_pd_pre_transition_notification( ctx->transition_pending_response_status = FWK_SUCCESS; out_params = - (struct clock_notification_params *)outbound_event.params; + (struct clock_notification_params *)(void *)outbound_event.params; /* * For now it is sufficient to assume that a PD ON state implies that @@ -518,8 +518,8 @@ static int clock_process_pd_transition_notification( }; pd_params = - (struct mod_pd_power_state_transition_notification_params *)event - ->params; + (struct mod_pd_power_state_transition_notification_params *) + (void *)event->params; fwk_assert(ctx->api->process_power_transition != NULL); status = ctx->api->process_power_transition( @@ -529,7 +529,8 @@ static int clock_process_pd_transition_notification( return status; /* Notify subscribers of the clock state change */ - out_params = (struct clock_notification_params *)outbound_event.params; + out_params = (struct clock_notification_params *) + (void *)outbound_event.params; if (pd_params->state == MOD_PD_STATE_ON) out_params->new_state = MOD_CLOCK_STATE_RUNNING; else @@ -565,7 +566,7 @@ static int clock_process_notification_response( return FWK_E_PANIC; resp_params = - (struct clock_state_change_pending_resp_params *)event->params; + (struct clock_state_change_pending_resp_params *)(void *)event->params; /* * Change the status used in the response to the power domain notification @@ -584,7 +585,7 @@ static int clock_process_notification_response( */ pd_resp_params = (struct mod_pd_power_state_pre_transition_notification_resp_params - *)pd_response_event.params; + *)(void *)pd_response_event.params; pd_resp_params->status = ctx->transition_pending_response_status; fwk_thread_put_event(&pd_response_event); } diff --git a/module/cmn600/src/mod_cmn600.c b/module/cmn600/src/mod_cmn600.c index 12a461e77cda8c3d2f2ab93447f1d822e86da228..e9cde7d570cf48288e7082c931b977bb093f9839 100644 --- a/module/cmn600/src/mod_cmn600.c +++ b/module/cmn600/src/mod_cmn600.c @@ -824,7 +824,7 @@ static int cmn600_process_notification( fwk_id_is_equal(event->id, mod_clock_notification_id_state_changed)); fwk_assert(fwk_id_is_type(event->target_id, FWK_ID_TYPE_MODULE)); - params = (struct clock_notification_params *)event->params; + params = (struct clock_notification_params *)(void *)event->params; if (params->new_state == MOD_CLOCK_STATE_RUNNING) cmn600_setup(); diff --git a/module/cmn_booker/src/mod_cmn_booker.c b/module/cmn_booker/src/mod_cmn_booker.c index 1c3060783d999875c58477a8ca106cddab43e4e6..a5062beb396136fcb65360e4bfbb47d634cd3edc 100644 --- a/module/cmn_booker/src/mod_cmn_booker.c +++ b/module/cmn_booker/src/mod_cmn_booker.c @@ -572,7 +572,7 @@ static int cmn_booker_process_notification( fwk_id_is_equal(event->id, mod_clock_notification_id_state_changed)); fwk_assert(fwk_id_is_type(event->target_id, FWK_ID_TYPE_MODULE)); - params = (struct clock_notification_params *)event->params; + params = (struct clock_notification_params *)(void *)event->params; if (params->new_state == MOD_CLOCK_STATE_RUNNING) cmn_booker_setup(); diff --git a/module/cmn_rhodes/src/mod_cmn_rhodes.c b/module/cmn_rhodes/src/mod_cmn_rhodes.c index bb118ce3a16c92b4c8edf4725a75392c3c8b6e0a..1b3adb0801152cc7aa621359d63eaa8130097b0d 100644 --- a/module/cmn_rhodes/src/mod_cmn_rhodes.c +++ b/module/cmn_rhodes/src/mod_cmn_rhodes.c @@ -875,7 +875,7 @@ static int cmn_rhodes_process_notification( mod_clock_notification_id_state_changed)); fwk_assert(fwk_id_is_type(event->target_id, FWK_ID_TYPE_ELEMENT)); - params = (struct clock_notification_params *)event->params; + params = (struct clock_notification_params *)(void *)event->params; if (params->new_state == MOD_CLOCK_STATE_RUNNING) { cmn_rhodes_setup(); cmn_rhodes_ccix_setup(); diff --git a/module/debug/src/mod_debug.c b/module/debug/src/mod_debug.c index c8caf26c85c391d38989a8f8a334777d96e502d0..d549cff4da33be044677b876b33b96f2db3f2390 100644 --- a/module/debug/src/mod_debug.c +++ b/module/debug/src/mod_debug.c @@ -95,7 +95,7 @@ static int set_enabled(fwk_id_t id, bool enable, enum scp_debug_user user_id) .response_requested = true, }; - req_params = (struct mod_debug_request_params *)&req.params; + req_params = (struct mod_debug_request_params *)(void *)req.params; req_params->user_id = user_id; req_params->enable = enable; @@ -138,7 +138,7 @@ static int get_enabled(fwk_id_t id, bool *enable, enum scp_debug_user user_id) .response_requested = true, }; - req_params = (struct mod_debug_request_params *)&req.params; + req_params = (struct mod_debug_request_params *)(void *)req.params; req_params->user_id = user_id; status = fwk_thread_put_event(&req); @@ -192,7 +192,7 @@ static int enable_request(fwk_id_t id, .id = mod_debug_event_id_req_drv, }; - req_params = (struct mod_debug_request_params *)&req.params; + req_params = (struct mod_debug_request_params *)(void *)req.params; req_params->user_id = user_id; req_params->enable = enable; @@ -210,7 +210,7 @@ static void request_complete(fwk_id_t id, struct fwk_event event; struct debug_dev_ctx *ctx; struct mod_debug_response_params *resp_params = - (struct mod_debug_response_params *)event.params; + (struct mod_debug_response_params *)(void *)event.params; fwk_assert(response != NULL); @@ -347,9 +347,9 @@ static int respond(const struct fwk_event *event) int status; struct fwk_event response; struct mod_debug_response_params *resp_params = - (struct mod_debug_response_params *)response.params; + (struct mod_debug_response_params *)(void *)response.params; struct mod_debug_response_params *req_result = - (struct mod_debug_response_params *)event->params; + (struct mod_debug_response_params *)(void *)event->params; struct debug_dev_ctx *ctx = &ctx_table[fwk_id_get_element_idx(event->target_id)]; @@ -379,7 +379,7 @@ static int mod_debug_process_event(const struct fwk_event *event, case MOD_DEBUG_PUBLIC_EVENT_IDX_REQ_ENABLE_GET: case MOD_DEBUG_PUBLIC_EVENT_IDX_REQ_ENABLE_SET: case MOD_DEBUG_EVENT_IDX_REQ_DRV: - req_params = (struct mod_debug_request_params *)event->params; + req_params = (struct mod_debug_request_params *)(void *)event->params; ctx->requester = req_params->user_id; /* Request from USER_AP we will need to respond */ @@ -403,7 +403,7 @@ static int mod_debug_process_event(const struct fwk_event *event, break; case MOD_DEBUG_EVENT_IDX_SET_COMPLETE: - req_result = (struct mod_debug_response_params *)event->params; + req_result = (struct mod_debug_response_params *)(void *)event->params; if (req_result->status == FWK_SUCCESS) mark_user(event->target_id, req_result->enabled, ctx->requester); diff --git a/module/dvfs/src/mod_dvfs.c b/module/dvfs/src/mod_dvfs.c index 605c2d1d944a3f468aaa22921d4c19bc613e4817..9cff27642c4a2b8052b0a4095ba839dddc323239 100644 --- a/module/dvfs/src/mod_dvfs.c +++ b/module/dvfs/src/mod_dvfs.c @@ -661,8 +661,9 @@ static void dvfs_complete_respond(struct mod_dvfs_domain_ctx *ctx, * the delayed_response and return it to the caller * with the data. */ - resp_params = (struct mod_dvfs_params_response *) - &read_req_event.params; + resp_params = + (struct mod_dvfs_params_response *) + (void *)read_req_event.params; status = fwk_thread_get_delayed_response(ctx->domain_id, ctx->cookie, &read_req_event); @@ -680,7 +681,7 @@ static void dvfs_complete_respond(struct mod_dvfs_domain_ctx *ctx, * the data to the caller in the resp_event. */ resp_params = - (struct mod_dvfs_params_response *)resp_event->params; + (struct mod_dvfs_params_response *)(void *)resp_event->params; resp_params->status = req_status; if (return_opp) resp_params->performance_level = ctx->current_opp.level; @@ -883,7 +884,7 @@ static int dvfs_handle_psu_set_voltage_resp(struct mod_dvfs_domain_ctx *ctx, { int status = FWK_SUCCESS; struct mod_psu_driver_response *psu_response = - (struct mod_psu_driver_response *)event->params; + (struct mod_psu_driver_response *)(void *)event->params; if (psu_response->status != FWK_SUCCESS) return dvfs_complete(ctx, NULL, psu_response->status); @@ -920,7 +921,7 @@ static int dvfs_handle_clk_set_freq_resp(struct mod_dvfs_domain_ctx *ctx, { int status; struct mod_clock_driver_resp_params *clock_response = - (struct mod_clock_driver_resp_params *)event->params; + (struct mod_clock_driver_resp_params *)(void *)event->params; if (clock_response->status != FWK_SUCCESS) return dvfs_complete(ctx, NULL, clock_response->status); @@ -1037,7 +1038,7 @@ static int mod_dvfs_process_event(const struct fwk_event *event, * Handle get_voltage() asynchronously, cookie will have been saved * above so we can safely discard the resp_event. */ - psu_response = (struct mod_psu_driver_response *)event->params; + psu_response = (struct mod_psu_driver_response *)(void *)event->params; status = dvfs_handle_psu_get_voltage_resp(ctx, NULL, psu_response->status, psu_response->voltage); if (status == FWK_PENDING) diff --git a/module/gtimer/src/mod_gtimer.c b/module/gtimer/src/mod_gtimer.c index 71993c4856e1bc9f1c55e16f90013efb81543055..986dbed4acc69b0aec2ca23a01bdd3975e013584 100644 --- a/module/gtimer/src/mod_gtimer.c +++ b/module/gtimer/src/mod_gtimer.c @@ -271,7 +271,7 @@ static int gtimer_process_notification( fwk_id_is_equal(event->id, mod_clock_notification_id_state_changed)); fwk_assert(fwk_id_is_type(event->target_id, FWK_ID_TYPE_ELEMENT)); - params = (struct clock_notification_params *)event->params; + params = (struct clock_notification_params *)(void *)event->params; if (params->new_state == MOD_CLOCK_STATE_RUNNING) { ctx = mod_gtimer_ctx.table + fwk_id_get_element_idx(event->target_id); diff --git a/module/i2c/src/mod_i2c.c b/module/i2c/src/mod_i2c.c index 0b552d687fea453825c7d090c647c52a08620d1e..6a094ad2d8c239801ac991014444dd4f5be61dc2 100644 --- a/module/i2c/src/mod_i2c.c +++ b/module/i2c/src/mod_i2c.c @@ -66,7 +66,7 @@ static int create_i2c_request(fwk_id_t dev_id, int status; struct fwk_event event; struct mod_i2c_request *event_param = - (struct mod_i2c_request *)event.params; + (struct mod_i2c_request *)(void *)event.params; /* The slave address should be on 7 bits */ if (!fwk_expect(request->slave_address < 0x80)) @@ -182,7 +182,7 @@ static void transaction_completed(fwk_id_t dev_id, int i2c_status) int status; struct fwk_event event; struct mod_i2c_event_param* param = - (struct mod_i2c_event_param *)event.params; + (struct mod_i2c_event_param *)(void *)event.params; event = (struct fwk_event) { .target_id = dev_id, @@ -283,7 +283,7 @@ static int respond_to_caller( int status; struct fwk_event resp; struct mod_i2c_event_param *param = - (struct mod_i2c_event_param *)resp.params; + (struct mod_i2c_event_param *)(void *)resp.params; status = fwk_thread_get_first_delayed_response(dev_id, &resp); if (status != FWK_SUCCESS) @@ -320,6 +320,10 @@ static int process_request(struct mod_i2c_dev_ctx *ctx, fwk_id_t event_id) ctx->state = MOD_I2C_DEV_RX; drv_status = driver_api->receive_as_master(driver_id, &ctx->request); break; + + default: + fwk_unexpected(); + break; } return drv_status; @@ -371,12 +375,13 @@ static int process_next_request(fwk_id_t dev_id, struct mod_i2c_dev_ctx *ctx) if (status != FWK_SUCCESS) return status; - request = (struct mod_i2c_request *)delayed_response.params; + request = (struct mod_i2c_request *)(void *)delayed_response.params; ctx->request = *request; drv_status = process_request(ctx, delayed_response.id); if (drv_status != FWK_PENDING) { - event_param = (struct mod_i2c_event_param *)delayed_response.params; + event_param = (struct mod_i2c_event_param *)(void *) + delayed_response.params; event_param->status = drv_status; status = fwk_thread_put_event(&delayed_response); @@ -404,7 +409,8 @@ static int mod_i2c_process_event(const struct fwk_event *event, if (is_request) { if (ctx->state == MOD_I2C_DEV_PANIC) { - event_param = (struct mod_i2c_event_param *)resp_event->params; + event_param = (struct mod_i2c_event_param *) + (void *)resp_event->params; event_param->status = FWK_E_PANIC; return FWK_SUCCESS; @@ -414,7 +420,7 @@ static int mod_i2c_process_event(const struct fwk_event *event, return FWK_SUCCESS; } - request = (struct mod_i2c_request *)event->params; + request = (struct mod_i2c_request *)(void *)event->params; ctx->request = *request; drv_status = process_request(ctx, event->id); @@ -423,7 +429,8 @@ static int mod_i2c_process_event(const struct fwk_event *event, resp_event->is_delayed_response = true; else { /* The request has succeeded or failed, respond now */ - resp_param = (struct mod_i2c_event_param *)resp_event->params; + resp_param = (struct mod_i2c_event_param *) + (void *)resp_event->params; resp_param->status = (drv_status == FWK_SUCCESS) ? FWK_SUCCESS : FWK_E_DEVICE; @@ -435,7 +442,7 @@ static int mod_i2c_process_event(const struct fwk_event *event, switch (fwk_id_get_event_idx(event->id)) { case MOD_I2C_EVENT_IDX_REQUEST_COMPLETED: - event_param = (struct mod_i2c_event_param *)event->params; + event_param = (struct mod_i2c_event_param *)(void *)event->params; if ((ctx->state == MOD_I2C_DEV_TX) || (ctx->state == MOD_I2C_DEV_RX)) { status = respond_to_caller(dev_id, ctx, event_param->status); diff --git a/module/msys_rom/src/mod_msys_rom.c b/module/msys_rom/src/mod_msys_rom.c index f6d0b44381ef6652f9906f7132b55063313eebb8..b7b7d6315bb3c1aeac75825606840f843419c056 100644 --- a/module/msys_rom/src/mod_msys_rom.c +++ b/module/msys_rom/src/mod_msys_rom.c @@ -129,7 +129,7 @@ static int msys_rom_process_event(const struct fwk_event *event, /* Notify any subscribers of the SYSTOP power domain state change */ notification_params = (struct mod_pd_power_state_transition_notification_params *) - systop_on_event.params; + (void *)systop_on_event.params; notification_params->state = MOD_PD_STATE_ON; status = fwk_notification_notify(&systop_on_event, &ctx.notification_count); diff --git a/module/pl011/src/mod_pl011.c b/module/pl011/src/mod_pl011.c index 2cbf7d407487c3c6362e78c5cc21b92ae89e45c8..8c299987687ffe533626cd6503c996b367a0cfef 100644 --- a/module/pl011/src/mod_pl011.c +++ b/module/pl011/src/mod_pl011.c @@ -345,10 +345,10 @@ static int mod_pl011_process_power_notification( pd_pre_transition_params = (struct mod_pd_power_state_pre_transition_notification_params *) - event->params; + (void *)event->params; pd_resp_params = (struct mod_pd_power_state_pre_transition_notification_resp_params - *)resp_event->params; + *)(void *)resp_event->params; switch (pd_pre_transition_params->target_state) { # ifdef BUILD_HAS_MOD_SYSTEM_POWER @@ -373,7 +373,7 @@ static int mod_pl011_process_power_notification( case MOD_PD_NOTIFICATION_IDX_POWER_STATE_TRANSITION: { struct mod_pd_power_state_transition_notification_params *params = (struct mod_pd_power_state_transition_notification_params *) - event->params; + (void *)event->params; if (params->state != MOD_PD_STATE_ON) status = FWK_SUCCESS; @@ -387,7 +387,7 @@ static int mod_pl011_process_power_notification( struct mod_pd_pre_shutdown_notif_resp_params *pd_pre_shutdown_resp_params = (struct mod_pd_pre_shutdown_notif_resp_params *) - resp_event->params; + (void *)resp_event->params; status = mod_pl011_powering_down(event->target_id); @@ -395,6 +395,10 @@ static int mod_pl011_process_power_notification( break; } + + default: + fwk_unexpected(); + break; } return status; @@ -497,6 +501,10 @@ static int mod_pl011_process_clock_notification( status = mod_pl011_clock_change_pending(event, resp_event); break; + + default: + fwk_unexpected(); + break; } return status; diff --git a/module/power_domain/src/mod_power_domain.c b/module/power_domain/src/mod_power_domain.c index 35f6d613b663eacf80643ff849400ad0b736f410..e4595a5aa35231fb849d473adf880400719ad081 100644 --- a/module/power_domain/src/mod_power_domain.c +++ b/module/power_domain/src/mod_power_domain.c @@ -451,7 +451,7 @@ static bool is_valid_composite_state(struct pd_ctx *target_pd, const uint32_t *state_mask_table; unsigned int table_size; - assert(target_pd != NULL); + fwk_assert(target_pd != NULL); if (!pd->cs_support) goto error; @@ -638,7 +638,7 @@ static bool initiate_power_state_pre_transition_notification(struct pd_ctx *pd) return true; params = (struct mod_pd_power_state_pre_transition_notification_params *) - notification_event.params; + (void *)notification_event.params; params->current_state = pd->current_state; params->target_state = state; @@ -720,9 +720,9 @@ static void respond(struct pd_ctx *pd, int resp_status) int status; struct fwk_event resp_event; const struct pd_set_state_request *req_params = - (struct pd_set_state_request *)(&resp_event.params); + (struct pd_set_state_request *)(void *)resp_event.params; struct pd_set_state_response *resp_params = - (struct pd_set_state_response *)(&resp_event.params); + (struct pd_set_state_response *)(void *)resp_event.params; if (!pd->response.pending) return; @@ -763,8 +763,8 @@ static void process_set_state_request( const struct pd_ctx *parent; const uint32_t *state_mask_table = NULL; - req_params = (struct pd_set_state_request *)event->params; - resp_params = (struct pd_set_state_response *)resp_event->params; + req_params = (struct pd_set_state_request *)(void *)event->params; + resp_params = (struct pd_set_state_response *)(void *)resp_event->params; pd_in_charge_of_response = NULL; first_power_state_transition_initiated = false; @@ -919,9 +919,9 @@ static int complete_system_suspend(struct pd_ctx *target_pd) struct pd_ctx *pd = target_pd; struct fwk_event event, resp_event; struct pd_set_state_request *event_params = - (struct pd_set_state_request *)event.params; + (struct pd_set_state_request *)(void *)event.params; struct pd_set_state_response *resp_params = - (struct pd_set_state_response *)(&resp_event.params); + (struct pd_set_state_response *)(void *)resp_event.params; const uint32_t *state_mask_table; int table_size; @@ -1131,7 +1131,7 @@ static void process_power_state_transition_report(struct pd_ctx *pd, if (pd->power_state_transition_notification_ctx.pending_responses == 0 && pd->config->disable_state_transition_notifications == false) { params = (struct mod_pd_power_state_transition_notification_params *) - notification_event.params; + (void *)notification_event.params; params->state = new_state; pd->power_state_transition_notification_ctx.state = new_state; fwk_notification_notify(¬ification_event, @@ -1301,12 +1301,12 @@ void perform_shutdown( delayed_resp.source_id = fwk_module_id_power_domain; - resp_params = (struct pd_response *)delayed_resp.params; + resp_params = (struct pd_response *)(void *)delayed_resp.params; resp_params->status = FWK_E_PANIC; status = fwk_thread_put_event(&delayed_resp); } else { - resp_params = (struct pd_response *)resp->params; + resp_params = (struct pd_response *)(void *)resp->params; resp_params->status = FWK_E_PANIC; status = fwk_thread_put_event(resp); @@ -1328,7 +1328,8 @@ static bool check_and_notify_system_shutdown( .response_requested = true }; - params = (struct mod_pd_pre_shutdown_notif_params *)notification.params; + params = (struct mod_pd_pre_shutdown_notif_params *) + (void *)notification.params; params->system_shutdown = system_shutdown; fwk_notification_notify( @@ -1348,8 +1349,9 @@ static void process_system_shutdown_request( enum mod_pd_system_shutdown system_shutdown; const struct pd_system_shutdown_request *req_params = - (struct pd_system_shutdown_request *)event->params; - struct pd_response *resp_params = (struct pd_response *)resp->params; + (struct pd_system_shutdown_request *)(void *)event->params; + struct pd_response *resp_params = + (struct pd_response *)(void *)resp->params; system_shutdown = req_params->system_shutdown; @@ -1420,10 +1422,10 @@ static int pd_set_state(fwk_id_t pd_id, uint32_t state) struct pd_ctx *pd; struct fwk_event req; struct fwk_event resp; - struct pd_set_state_request *req_params = - (struct pd_set_state_request *)(&req.params); - struct pd_set_state_response *resp_params = - (struct pd_set_state_response *)(&resp.params); + struct pd_set_state_request *req_params = (struct pd_set_state_request *) + (void *)req.params; + struct pd_set_state_response *resp_params = (struct pd_set_state_response *) + (void *)resp.params; pd = &mod_pd_ctx.pd_ctx_table[fwk_id_get_element_idx(pd_id)]; @@ -1459,7 +1461,7 @@ static int pd_set_state_async( struct pd_ctx *pd; struct fwk_event req; struct pd_set_state_request *req_params = - (struct pd_set_state_request *)(&req.params); + (struct pd_set_state_request *)(void *)req.params; pd = &mod_pd_ctx.pd_ctx_table[fwk_id_get_element_idx(pd_id)]; @@ -1490,9 +1492,9 @@ static int pd_get_state(fwk_id_t pd_id, unsigned int *state) struct fwk_event req; struct fwk_event resp; struct pd_get_state_request *req_params = - (struct pd_get_state_request *)(&req.params); + (struct pd_get_state_request *)(void *)req.params; struct pd_get_state_response *resp_params = - (struct pd_get_state_response *)(&resp.params); + (struct pd_get_state_response *)(void *)resp.params; if (state == NULL) return FWK_E_PARAM; @@ -1522,7 +1524,7 @@ static int pd_reset(fwk_id_t pd_id) int status; struct fwk_event req; struct fwk_event resp; - struct pd_response *resp_params = (struct pd_response *)(&resp.params); + struct pd_response *resp_params = (struct pd_response *)(void *)resp.params; req = (struct fwk_event) { .id = FWK_ID_EVENT(FWK_MODULE_IDX_POWER_DOMAIN, PD_EVENT_IDX_RESET), @@ -1542,8 +1544,8 @@ static int pd_system_suspend(unsigned int state) struct fwk_event req; struct fwk_event resp; struct pd_system_suspend_request *req_params = - (struct pd_system_suspend_request *)(&req.params); - struct pd_response *resp_params = (struct pd_response *)(&resp.params); + (struct pd_system_suspend_request *)(void *)req.params; + struct pd_response *resp_params = (struct pd_response *)(void *)resp.params; req = (struct fwk_event) { .id = FWK_ID_EVENT(FWK_MODULE_IDX_POWER_DOMAIN, @@ -1565,7 +1567,7 @@ static int pd_system_shutdown(enum mod_pd_system_shutdown system_shutdown) int status; struct fwk_event req; struct pd_system_shutdown_request *req_params = - (struct pd_system_shutdown_request *)(&req.params); + (struct pd_system_shutdown_request *)(void *)req.params; req = (struct fwk_event) { .id = FWK_ID_EVENT(FWK_MODULE_IDX_POWER_DOMAIN, @@ -1606,7 +1608,7 @@ static int report_power_state_transition(const struct pd_ctx *pd, { struct fwk_event report; struct pd_power_state_transition_report *report_params = - (struct pd_power_state_transition_report *)(&report.params); + (struct pd_power_state_transition_report *)(void *)report.params; report = (struct fwk_event){ .source_id = pd->driver_id, @@ -1694,7 +1696,7 @@ static int pd_power_domain_init(fwk_id_t pd_id, unsigned int unused, const void *config) { const struct mod_power_domain_element_config *pd_config = - (const struct mod_power_domain_element_config *)config; + (const struct mod_power_domain_element_config *)(void *)config; struct pd_ctx *pd; unsigned int state; @@ -1905,15 +1907,15 @@ static int pd_process_event(const struct fwk_event *event, fwk_assert(pd != NULL); process_get_state_request(pd, - (struct pd_get_state_request *)event->params, - (struct pd_get_state_response *)resp->params); + (struct pd_get_state_request *)(void *)event->params, + (struct pd_get_state_response *)(void *)resp->params); return FWK_SUCCESS; case PD_EVENT_IDX_RESET: fwk_assert(pd != NULL); - process_reset_request(pd, (struct pd_response *)resp->params); + process_reset_request(pd, (struct pd_response *)(void *)resp->params); return FWK_SUCCESS; @@ -1921,14 +1923,14 @@ static int pd_process_event(const struct fwk_event *event, fwk_assert(pd != NULL); process_power_state_transition_report(pd, - (struct pd_power_state_transition_report *)event->params); + (struct pd_power_state_transition_report *)(void *)event->params); return FWK_SUCCESS; case PD_EVENT_IDX_SYSTEM_SUSPEND: process_system_suspend_request( - (struct pd_system_suspend_request *)event->params, - (struct pd_response *)resp->params); + (struct pd_system_suspend_request *)(void *)event->params, + (struct pd_response *)(void *)resp->params); return FWK_SUCCESS; @@ -2049,7 +2051,7 @@ static int process_power_state_transition_notification_response( notification_event.source_id = FWK_ID_NONE; params = (struct mod_pd_power_state_transition_notification_params *) - notification_event.params; + (void *)notification_event.params; params->state = pd->current_state; pd->power_state_transition_notification_ctx.state = pd->current_state; @@ -2086,7 +2088,7 @@ static int pd_process_notification(const struct fwk_event *event, return process_power_state_pre_transition_notification_response(pd, (struct mod_pd_power_state_pre_transition_notification_resp_params *) - event->params); + (void *)event->params); } /* Module definition */ diff --git a/module/ppu_v1/src/mod_ppu_v1.c b/module/ppu_v1/src/mod_ppu_v1.c index 2a31a27b0592a31852672e9beec3c881022716d3..418034d02229fdeac96af0ef1fcad0dfceaadf7a 100644 --- a/module/ppu_v1/src/mod_ppu_v1.c +++ b/module/ppu_v1/src/mod_ppu_v1.c @@ -958,7 +958,7 @@ static int ppu_v1_process_notification( (void)module_config; params = (struct mod_pd_power_state_transition_notification_params *) - event->params; + (void *)event->params; if (params->state != MOD_PD_STATE_ON) return FWK_SUCCESS; diff --git a/module/psu/src/mod_psu.c b/module/psu/src/mod_psu.c index b89296eefc5b7668dbf90fba8d41bb3a29031f7d..f8d860dd5dca5f1f1e72cfea9cd56f9d05d72224 100644 --- a/module/psu/src/mod_psu.c +++ b/module/psu/src/mod_psu.c @@ -358,6 +358,10 @@ static int mod_psu_process_bind_request( *api = &mod_psu_driver_response_api; break; + + default: + fwk_unexpected(); + break; } return FWK_SUCCESS; @@ -372,11 +376,11 @@ static int mod_psu_process_event( struct fwk_event hal_event; const struct mod_psu_driver_response *params = - (struct mod_psu_driver_response *)event->params; + (struct mod_psu_driver_response *)(void *)event->params; struct mod_psu_response *resp_params = - (struct mod_psu_response *)resp_event->params; + (struct mod_psu_response *)(void *)resp_event->params; struct mod_psu_response *hal_params = - (struct mod_psu_response *)&hal_event.params; + (struct mod_psu_response *)(void *)hal_event.params; const struct mod_psu_element_cfg *cfg; struct mod_psu_element_ctx *ctx; diff --git a/module/reset_domain/src/mod_reset_domain.c b/module/reset_domain/src/mod_reset_domain.c index 5c60d0781bfb07c01a9e7149ed9db62cde575144..fdb49a916fc15c87315c80c9be646acefabe4be0 100644 --- a/module/reset_domain/src/mod_reset_domain.c +++ b/module/reset_domain/src/mod_reset_domain.c @@ -73,7 +73,7 @@ static int reset_issued_notify(fwk_id_t dev_id, struct mod_reset_domain_notification_event_params* params = (struct mod_reset_domain_notification_event_params*) - notification_event.params; + (void *)notification_event.params; /* Loop through device context table to get the associated domain_id */ for (i = 0; i < module_reset_ctx.dev_count; i++) { @@ -99,7 +99,7 @@ static int rd_process_event( struct fwk_event *resp) { struct mod_reset_domain_autoreset_event_params* params = - (struct mod_reset_domain_autoreset_event_params*)event->params; + (struct mod_reset_domain_autoreset_event_params*)(void *)event->params; if (!fwk_id_is_equal(mod_reset_domain_autoreset_event_id, event->id)) diff --git a/module/scmi_clock/src/mod_scmi_clock.c b/module/scmi_clock/src/mod_scmi_clock.c index 02d852f3bab84d1d0673c7e8084456a89cc2be2a..d78fda080c4f13b7c2233a8449425273e8ba1345 100644 --- a/module/scmi_clock/src/mod_scmi_clock.c +++ b/module/scmi_clock/src/mod_scmi_clock.c @@ -648,7 +648,7 @@ static int create_event_request( .target_id = fwk_module_id_scmi_clock, }; - params = (struct event_request_params *)event.params; + params = (struct event_request_params *)(void *)event.params; switch (request) { case SCMI_CLOCK_REQUEST_GET_STATE: @@ -1365,7 +1365,7 @@ static int process_request_event(const struct fwk_event *event) struct event_set_state_request_data set_state_data; fwk_id_t service_id; - params = (struct event_request_params *)event->params; + params = (struct event_request_params *)(void *)event->params; clock_dev_idx = fwk_id_get_element_idx(params->clock_dev_id); service_id = clock_ops_get_service(clock_dev_idx); @@ -1437,7 +1437,7 @@ static int process_request_event(const struct fwk_event *event) static int process_response_event(const struct fwk_event *event) { struct mod_clock_resp_params *params = - (struct mod_clock_resp_params *)event->params; + (struct mod_clock_resp_params *)(void *)event->params; unsigned int clock_dev_idx; fwk_id_t service_id; enum mod_clock_state clock_state; diff --git a/module/scmi_perf/src/mod_scmi_perf.c b/module/scmi_perf/src/mod_scmi_perf.c index aee18c01a099757782bdc3e3f0600390717c7124..5f7c2bfd38f06698fed0cda0ca9ba44b2fdaed4e 100644 --- a/module/scmi_perf/src/mod_scmi_perf.c +++ b/module/scmi_perf/src/mod_scmi_perf.c @@ -621,7 +621,7 @@ static int scmi_perf_limits_get_handler(fwk_id_t service_id, .id = scmi_perf_get_limits, }; - evt_params = (struct scmi_perf_event_parameters *)event.params; + evt_params = (struct scmi_perf_event_parameters *)(void *)event.params; evt_params->domain_id = domain_id; status = fwk_thread_put_event(&event); @@ -739,7 +739,7 @@ static int scmi_perf_level_get_handler(fwk_id_t service_id, .id = scmi_perf_get_level, }; - evt_params = (struct scmi_perf_event_parameters *)event.params; + evt_params = (struct scmi_perf_event_parameters *)(void *)event.params; evt_params->domain_id = FWK_ID_ELEMENT(FWK_MODULE_IDX_DVFS, parameters->domain_id); @@ -775,7 +775,7 @@ static int scmi_perf_limits_notify(fwk_id_t service_id, .status = SCMI_GENERIC_ERROR, }; - parameters = (const struct scmi_perf_notify_limits_a2p *)payload; + parameters = (const struct scmi_perf_notify_limits_a2p *)(void *)payload; id = parameters->domain_id; if (id >= scmi_perf_ctx.domain_count) { status = FWK_SUCCESS; @@ -831,7 +831,7 @@ static int scmi_perf_level_notify(fwk_id_t service_id, .status = SCMI_GENERIC_ERROR, }; - parameters = (const struct scmi_perf_notify_level_a2p *)payload; + parameters = (const struct scmi_perf_notify_level_a2p *)(void *)payload; id = parameters->domain_id; if (id >= scmi_perf_ctx.domain_count) { status = FWK_SUCCESS; @@ -895,7 +895,7 @@ static int scmi_perf_describe_fast_channels(fwk_id_t service_id, }; uint32_t chan_size, chan_index; - parameters = (const struct scmi_perf_describe_fc_a2p *)payload; + parameters = (const struct scmi_perf_describe_fc_a2p *)(void *)payload; /* Validate the domain identifier */ if (parameters->domain_id >= scmi_perf_ctx.domain_count) { @@ -1491,7 +1491,7 @@ static int process_request_event(const struct fwk_event *event) /* request event to DVFS HAL */ if (fwk_id_is_equal(event->id, scmi_perf_get_level)) { - params = (struct scmi_perf_event_parameters *)event->params; + params = (struct scmi_perf_event_parameters *)(void *)event->params; status = scmi_perf_ctx.dvfs_api->get_current_opp(params->domain_id, &opp); @@ -1522,7 +1522,7 @@ static int process_request_event(const struct fwk_event *event) } if (fwk_id_is_equal(event->id, scmi_perf_get_limits)) { - params = (struct scmi_perf_event_parameters *)event->params; + params = (struct scmi_perf_event_parameters *)(void *)event->params; status = scmi_perf_ctx.dvfs_api->get_level_limits( params->domain_id, &limits); @@ -1567,7 +1567,7 @@ static int process_response_event(const struct fwk_event *event) if (fwk_id_is_equal(event->id, mod_dvfs_event_id_get_opp)) { params_level = (struct mod_dvfs_params_response *) - event->params; + (void *)event->params; return_values_level = (struct scmi_perf_level_get_p2a) { .status = params_level->status, .performance_level = params_level->performance_level, diff --git a/module/scmi_power_domain/src/mod_scmi_power_domain.c b/module/scmi_power_domain/src/mod_scmi_power_domain.c index d853099b498fe89d5f8effa201342fe39688b1cc..7d80c508f8c81122d15967d9431c4e8d32a51381 100644 --- a/module/scmi_power_domain/src/mod_scmi_power_domain.c +++ b/module/scmi_power_domain/src/mod_scmi_power_domain.c @@ -584,7 +584,7 @@ static int scmi_pd_power_state_set_handler(fwk_id_t service_id, }; struct event_request_params *event_params = - (struct event_request_params *)event.params; + (struct event_request_params *)(void *)event.params; event_params->pd_power_state = pd_power_state; event_params->pd_id = pd_id; @@ -615,8 +615,7 @@ static int scmi_pd_power_state_set_handler(fwk_id_t service_id, ops_set_busy(pd_id, service_id); return FWK_SUCCESS; - #endif - +#endif /* BUILD_HAS_MOD_DEBUG */ case MOD_PD_TYPE_DEVICE: if (!is_sync) { return_values.status = SCMI_NOT_SUPPORTED; @@ -694,7 +693,7 @@ static int scmi_pd_power_state_get_handler(fwk_id_t service_id, #ifdef BUILD_HAS_MOD_DEBUG struct fwk_event event; struct event_request_params *event_params; - #endif +#endif parameters = (const struct scmi_pd_power_state_get_a2p *)payload; @@ -727,7 +726,7 @@ static int scmi_pd_power_state_get_handler(fwk_id_t service_id, .id = mod_scmi_pd_event_id_dbg_enable_get, }; - event_params = (struct event_request_params *)event.params; + event_params = (struct event_request_params *)(void *)event.params; event_params->pd_id = pd_id; @@ -738,7 +737,7 @@ static int scmi_pd_power_state_get_handler(fwk_id_t service_id, ops_set_busy(pd_id, service_id); return FWK_SUCCESS; - #endif +#endif case MOD_PD_TYPE_DEVICE: status = scmi_pd_ctx.pd_api->get_state(pd_id, &pd_power_state); @@ -1035,7 +1034,7 @@ static int scmi_pd_init(fwk_id_t module_id, unsigned int element_count, { #ifdef BUILD_HAS_MOD_DEBUG struct mod_scmi_pd_config *config = (struct mod_scmi_pd_config *)data; - #endif +#endif if (element_count != 0) return FWK_E_SUPPORT; @@ -1061,7 +1060,7 @@ static int scmi_pd_init(fwk_id_t module_id, unsigned int element_count, scmi_pd_ctx.debug_id = config->debug_id; } else return FWK_E_DATA; - #endif +#endif /* Allocate a table of scmi_pd operations */ scmi_pd_ctx.ops = @@ -1128,7 +1127,7 @@ static int scmi_pd_bind(fwk_id_t id, unsigned int round) &scmi_pd_ctx.debug_api); if (status != FWK_SUCCESS) return status; - #endif +#endif #ifdef BUILD_HAS_RESOURCE_PERMISSIONS status = fwk_module_bind( @@ -1171,7 +1170,7 @@ static int process_request_event(const struct fwk_event *event) .status = SCMI_GENERIC_ERROR }; - params = (struct event_request_params *)event->params; + params = (struct event_request_params *)(void *)event->params; /* * Internal events: @@ -1238,7 +1237,7 @@ static int process_response_event(const struct fwk_event *event, bool get) }; struct mod_debug_response_params *params = - (struct mod_debug_response_params *)event->params; + (struct mod_debug_response_params *)(void *)event->params; /* * We know this event comes from the DEBUG HAL for now so we use the @@ -1306,7 +1305,7 @@ static int scmi_pd_process_notification( unsigned int agent_id; uint32_t state; struct mod_pd_power_state_transition_notification_params *event_params = - ((struct mod_pd_power_state_transition_notification_params *) + ((struct mod_pd_power_state_transition_notification_params *)(void *) event->params); if (fwk_id_is_equal( diff --git a/module/scmi_sensor/src/mod_scmi_sensor.c b/module/scmi_sensor/src/mod_scmi_sensor.c index 802c24553e92e4f5ca98e43fc3793bc9fc8583c0..b1fc11cbb2783139df1b6e633da6c334716d0edc 100644 --- a/module/scmi_sensor/src/mod_scmi_sensor.c +++ b/module/scmi_sensor/src/mod_scmi_sensor.c @@ -537,7 +537,7 @@ static int scmi_sensor_reading_get_handler(fwk_id_t service_id, .id = mod_scmi_sensor_event_id_get_request, }; - params = (struct scmi_sensor_event_parameters *)event.params; + params = (struct scmi_sensor_event_parameters *)(void *)event.params; params->sensor_id = FWK_ID_ELEMENT(FWK_MODULE_IDX_SENSOR, sensor_idx); @@ -852,7 +852,7 @@ static int scmi_sensor_process_event(const struct fwk_event *event, /* Request event to sensor HAL */ if (fwk_id_is_equal(event->id, mod_scmi_sensor_event_id_get_request)) { - params = (struct scmi_sensor_event_parameters *)event->params; + params = (struct scmi_sensor_event_parameters *)(void *)event->params; status = scmi_sensor_ctx.sensor_api->get_value(params->sensor_id, &sensor_value); @@ -884,7 +884,7 @@ static int scmi_sensor_process_event(const struct fwk_event *event, /* Response event from sensor HAL */ if (fwk_id_is_equal(event->id, mod_sensor_event_id_read_request)) { struct mod_sensor_event_params *params = - (struct mod_sensor_event_params *)event->params; + (struct mod_sensor_event_params *)(void *)event->params; return_values = (struct scmi_sensor_protocol_reading_get_p2a) { .sensor_value_low = (uint32_t)params->value, diff --git a/module/sensor/src/mod_sensor.c b/module/sensor/src/mod_sensor.c index db5da16a2b78a4e91c15aa12b963f33594a8b182..5354d1d9656c26c5139e58df3c46ff4438e9c5d9 100644 --- a/module/sensor/src/mod_sensor.c +++ b/module/sensor/src/mod_sensor.c @@ -220,7 +220,7 @@ static void reading_complete(fwk_id_t dev_id, struct fwk_event event; struct sensor_dev_ctx *ctx; struct mod_sensor_event_params *event_params = - (struct mod_sensor_event_params *)event.params; + (struct mod_sensor_event_params *)(void *)event.params; if (!fwk_expect(fwk_id_get_module_idx(dev_id) == FWK_MODULE_IDX_SENSOR)) return; @@ -375,9 +375,9 @@ static int sensor_process_event(const struct fwk_event *event, struct sensor_dev_ctx *ctx; struct fwk_event read_req_event; struct mod_sensor_event_params *event_params = - (struct mod_sensor_event_params *)(event->params); + (struct mod_sensor_event_params *)(void *)event->params; struct mod_sensor_event_params *resp_params = - (struct mod_sensor_event_params *)(read_req_event.params); + (struct mod_sensor_event_params *)(void *)read_req_event.params; if (!fwk_module_is_valid_element_id(event->target_id)) return FWK_E_PARAM; diff --git a/module/smt/src/mod_smt.c b/module/smt/src/mod_smt.c index 3fb7dfeb64cc2c7c3448fbf38681dfefe062952e..4bedce6b125b72af445de47bc952cf1d9147edf4 100644 --- a/module/smt/src/mod_smt.c +++ b/module/smt/src/mod_smt.c @@ -572,12 +572,12 @@ static int smt_process_notification( unsigned int notifications_sent; int status; - assert(fwk_id_is_equal(event->id, + fwk_assert(fwk_id_is_equal(event->id, mod_pd_notification_id_power_state_transition)); fwk_assert(fwk_id_is_type(event->target_id, FWK_ID_TYPE_ELEMENT)); params = (struct mod_pd_power_state_transition_notification_params *) - event->params; + (void *)event->params; channel_ctx = &smt_ctx.channel_ctx_table[fwk_id_get_element_idx(event->target_id)]; diff --git a/product/rcar/module/rcar_clock/src/mod_rcar_clock.c b/product/rcar/module/rcar_clock/src/mod_rcar_clock.c index 73f7e5abdcfbae00fbe89200b0d807487ff9e5e7..c30305b46cfc014edc51ea6fd664f31192c729c8 100644 --- a/product/rcar/module/rcar_clock/src/mod_rcar_clock.c +++ b/product/rcar/module/rcar_clock/src/mod_rcar_clock.c @@ -16,7 +16,6 @@ #include #include -#include #include #include diff --git a/product/rcar/module/rcar_scif/src/mod_rcar_scif.c b/product/rcar/module/rcar_scif/src/mod_rcar_scif.c index 26ed7ffaafc278d1da6ac1976d93827421df31a2..92d402ead471ee4f33ff6a2b79b1aa41ed7a0fa1 100644 --- a/product/rcar/module/rcar_scif/src/mod_rcar_scif.c +++ b/product/rcar/module/rcar_scif/src/mod_rcar_scif.c @@ -12,13 +12,13 @@ #include +#include #include #include #include #include #include -#include struct mod_rcar_scif_element_ctx { /* Whether the device has an open file stream */ @@ -72,7 +72,7 @@ static int mod_rcar_scif_set_baud_rate( uint32_t status; int i; - assert(reg); + fwk_assert(reg); current_cfg = cfg; if (reg == (void *)BOARD_UART1_BASE) {