From a31e094b37dc904cbbfcd41c1a82e90a30d1e5bd Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Mon, 5 Dec 2022 12:03:58 +0100 Subject: [PATCH 1/5] framework: fix missing prototypes issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes several missing prototypes issues reported when building with OP-TEE as showed in below traces. /tmp/optee-3.19-stm32mp1/optee_os/../scp-firmware/framework/src/fwk_string.c:16:6: error: no previous prototype for ‘fwk_str_memset’ [-Werror=missing-prototypes] 16 | void fwk_str_memset(void *dest, int ch, size_t count) | ^~~~~~~~~~~~~~ /tmp/optee-3.19-stm32mp1/optee_os/../scp-firmware/framework/src/fwk_string.c:44:6: error: no previous prototype for ‘fwk_str_strncpy’ [-Werror=missing-prototypes] 44 | void fwk_str_strncpy(char *dest, const char *src, size_t count) | ^~~~~~~~~~~~~~~ /tmp/optee-3.19-stm32mp1/optee_os/../scp-firmware/framework/src/fwk_delayed_resp.c:43:19: error: no previous prototype for ‘__fwk_get_delayed_response_list’ [-Werror=missing-prototypes] 43 | struct fwk_slist *__fwk_get_delayed_response_list(fwk_id_t id) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/optee-3.19-stm32mp1/optee_os/../scp-firmware/framework/src/fwk_delayed_resp.c:52:19: error: no previous prototype for ‘__fwk_search_delayed_response’ [-Werror=missing-prototypes] 52 | struct fwk_event *__fwk_search_delayed_response(fwk_id_t id, uint32_t cookie) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/optee-3.19-stm32mp1/optee_os/../scp-firmware/framework/src/fwk_delayed_resp.c:79:5: error: no previous prototype for ‘fwk_get_delayed_response’ [-Werror=missing-prototypes] 79 | int fwk_get_delayed_response( | ^~~~~~~~~~~~~~~~~~~~~~~~ /tmp/optee-3.19-stm32mp1/optee_os/../scp-firmware/framework/src/fwk_delayed_resp.c:107:5: error: no previous prototype for ‘fwk_is_delayed_response_list_empty’ [-Werror=missing-prototypes] 107 | int fwk_is_delayed_response_list_empty(fwk_id_t id, bool *is_empty) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/optee-3.19-stm32mp1/optee_os/../scp-firmware/framework/src/fwk_delayed_resp.c:130:5: error: no previous prototype for ‘fwk_get_first_delayed_response’ [-Werror=missing-prototypes] 130 | int fwk_get_first_delayed_response(fwk_id_t id, struct fwk_event *event) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/optee-3.19-stm32mp1/optee_os/../scp-firmware/framework/src/fwk_time.c:20:22: error: no previous prototype for ‘fwk_time_init’ [-Werror=missing-prototypes] 20 | FWK_CONSTRUCTOR void fwk_time_init(void) | ^~~~~~~~~~~~~ This change adds inclusion of few header files in some framework source files and adds static attribute to fwk_time_init() function that is local to its definition source file. Signed-off-by: Etienne Carriere --- framework/src/fwk_delayed_resp.c | 2 ++ framework/src/fwk_string.c | 1 + framework/src/fwk_time.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/src/fwk_delayed_resp.c b/framework/src/fwk_delayed_resp.c index fcb35214c..79671a418 100644 --- a/framework/src/fwk_delayed_resp.c +++ b/framework/src/fwk_delayed_resp.c @@ -5,8 +5,10 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include #include +#include #include #include #include diff --git a/framework/src/fwk_string.c b/framework/src/fwk_string.c index 65aa69556..2ecca2464 100644 --- a/framework/src/fwk_string.c +++ b/framework/src/fwk_string.c @@ -10,6 +10,7 @@ #include #include +#include #include diff --git a/framework/src/fwk_time.c b/framework/src/fwk_time.c index 6a3e68a25..6053185e4 100644 --- a/framework/src/fwk_time.c +++ b/framework/src/fwk_time.c @@ -17,7 +17,7 @@ struct { const void *driver_ctx; /* Time driver context */ } fwk_time_ctx; -FWK_CONSTRUCTOR void fwk_time_init(void) +static FWK_CONSTRUCTOR void fwk_time_init(void) { struct fwk_time_driver driver = fmw_time_driver(&fwk_time_ctx.driver_ctx); -- GitLab From f34bd93dcb6c0d653132645d5016e6db95043943 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Mon, 5 Dec 2022 12:11:47 +0100 Subject: [PATCH 2/5] module/msg-smt: fix missing prototypes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makes msg_signal_message() a local static function. This fixes a build issue reported when building with OP-TEE: /tmp/optee-3.19-stm32mp1/optee_os/../scp-firmware/module/msg_smt/src/mod_msg_smt.c:278:5: error: no previous prototype for ‘msg_signal_message’ [-Werror=missing-prototypes] 278 | int msg_signal_message(fwk_id_t channel_id, void *msg_in, size_t in_len, void *msg_out, size_t out_len) | ^~~~~~~~~~~~~~~~~~ Signed-off-by: Etienne Carriere --- module/msg_smt/src/mod_msg_smt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/msg_smt/src/mod_msg_smt.c b/module/msg_smt/src/mod_msg_smt.c index 20c8d6bff..6e1cbd1e4 100644 --- a/module/msg_smt/src/mod_msg_smt.c +++ b/module/msg_smt/src/mod_msg_smt.c @@ -275,7 +275,7 @@ static int smt_completer_handler(struct smt_channel_ctx *channel_ctx) return FWK_SUCCESS; } -int msg_signal_message(fwk_id_t channel_id, void *msg_in, size_t in_len, void *msg_out, size_t out_len) +static int msg_signal_message(fwk_id_t channel_id, void *msg_in, size_t in_len, void *msg_out, size_t out_len) { struct smt_channel_ctx *channel_ctx; -- GitLab From efb64f159b9330fcb83bc7ee6e0072e5b936972b Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Mon, 5 Dec 2022 12:13:21 +0100 Subject: [PATCH 3/5] module/power_domain: fix missing prototypes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makes perform_shutdown() a local static function and includes header file power_domain_utils.h from power_domain_utils.c. These changes fix missing prototypes build issues reported when building with OP-TEE: /tmp/optee-3.19-stm32mp1/optee_os/../scp-firmware/module/power_domain/src/mod_power_domain.c:1308:6: error: no previous prototype for ‘perform_shutdown’ [-Werror=missing-prototypes] 1308 | void perform_shutdown( | ^~~~~~~~~~~~~~~~ /tmp/optee-3.19-stm32mp1/optee_os/../scp-firmware/module/power_domain/src/power_domain_utils.c:99:27: error: no previous prototype for ‘create_power_domain_element_table’ [-Werror=missing-prototypes] 99 | const struct fwk_element *create_power_domain_element_table( | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Etienne Carriere --- module/power_domain/src/mod_power_domain.c | 2 +- module/power_domain/src/power_domain_utils.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/module/power_domain/src/mod_power_domain.c b/module/power_domain/src/mod_power_domain.c index 2b1cc6b61..b8e4ef381 100644 --- a/module/power_domain/src/mod_power_domain.c +++ b/module/power_domain/src/mod_power_domain.c @@ -1305,7 +1305,7 @@ static void process_system_suspend_request( resp_params->status = status; } -void perform_shutdown( +static void perform_shutdown( enum mod_pd_system_shutdown system_shutdown, struct fwk_event *resp) { diff --git a/module/power_domain/src/power_domain_utils.c b/module/power_domain/src/power_domain_utils.c index 5953166f2..d1a26d08a 100644 --- a/module/power_domain/src/power_domain_utils.c +++ b/module/power_domain/src/power_domain_utils.c @@ -9,6 +9,7 @@ */ #include +#include #include #include -- GitLab From 4153cd0a64cf88a444abce841ff3b54f54b7c4a4 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Mon, 5 Dec 2022 12:14:57 +0100 Subject: [PATCH 4/5] module/scmi_perf: fix missing prototypes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Includes local header file scmi_perf.h from mod_scmi_perf.c to fix a missing prototypes issue reported when building with OP-TEE: /tmp/optee-3.19-stm32mp1/optee_os/../scp-firmware/module/scmi_perf/src/mod_scmi_perf.c:400:5: error: no previous prototype for ‘perf_set_limits’ [-Werror=missing-prototypes] 400 | int perf_set_limits( | ^~~~~~~~~~~~~~~ Signed-off-by: Etienne Carriere --- module/scmi_perf/src/mod_scmi_perf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/module/scmi_perf/src/mod_scmi_perf.c b/module/scmi_perf/src/mod_scmi_perf.c index 2709166ae..b7f057b3b 100644 --- a/module/scmi_perf/src/mod_scmi_perf.c +++ b/module/scmi_perf/src/mod_scmi_perf.c @@ -17,6 +17,7 @@ # include "perf_plugins_handler.h" #endif #include +#include "scmi_perf.h" #include #include -- GitLab From 8333f953eae5888a5a89fbeed683c8cec374aa48 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Mon, 5 Dec 2022 12:09:02 +0100 Subject: [PATCH 5/5] module/scmi: fix missing prototypes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moves declaration scmi_send_message() and response_message_handler() functions from module scmi_system_power_req test header file to module scmi internal/mod_scmi.h since these functions are defined in that module. This fixes a build issue reported when building with OP-TEE: /tmp/optee-3.19-stm32mp1/build/../scp-firmware/module/scmi/src/mod_scmi.c:378:5: error: no previous prototype for ‘scmi_send_message’ [-Werror=missing-prototypes] 378 | int scmi_send_message( | ^~~~~~~~~~~~~~~~~ /tmp/optee-3.19-stm32mp1/build/../scp-firmware/module/scmi/src/mod_scmi.c:442:5: error: no previous prototype for ‘response_message_handler’ [-Werror=missing-prototypes] 442 | int response_message_handler(fwk_id_t service_id) | ^~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Etienne Carriere --- module/scmi/include/internal/mod_scmi.h | 13 +++++++++++++ .../test/mod_scmi_system_power_req_extra.h | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/module/scmi/include/internal/mod_scmi.h b/module/scmi/include/internal/mod_scmi.h index 5d243e3a2..63320bf33 100644 --- a/module/scmi/include/internal/mod_scmi.h +++ b/module/scmi/include/internal/mod_scmi.h @@ -110,4 +110,17 @@ struct mod_scmi_ctx { #endif }; +/*! Send an SCMI message */ +int scmi_send_message( + uint8_t scmi_message_id, + uint8_t scmi_protocol_id, + uint8_t token, + fwk_id_t service_id, + const void *payload, + size_t payload_size, + bool request_ack_by_interrupt); + +/*! Handle response SCMI message */ +int response_message_handler(fwk_id_t service_id); + #endif /* MOD_INTERNAL_SCMI_H */ diff --git a/module/scmi_system_power_req/test/mod_scmi_system_power_req_extra.h b/module/scmi_system_power_req/test/mod_scmi_system_power_req_extra.h index 581efb976..2319f280a 100644 --- a/module/scmi_system_power_req/test/mod_scmi_system_power_req_extra.h +++ b/module/scmi_system_power_req/test/mod_scmi_system_power_req_extra.h @@ -9,19 +9,6 @@ */ #include -/*! Send an SCMI message */ -int scmi_send_message( - uint8_t scmi_message_id, - uint8_t scmi_protocol_id, - uint8_t token, - fwk_id_t service_id, - const void *payload, - size_t payload_size, - bool request_ack_by_interrupt); - -/*! Handle response SCMI message */ -int response_message_handler(fwk_id_t service_id); - /* * used as a mock for message handlers */ -- GitLab