From 97fe51df8f9567250b3fa22e23e09f9a3e262b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20=C3=9Cr=C3=BCn?= Date: Thu, 2 Mar 2023 13:53:44 +0100 Subject: [PATCH] Specify void as argument for the functions without any arguments --- faultplugin/fault_list.c | 6 +++--- faultplugin/fault_list.h | 6 +++--- faultplugin/faultplugin.c | 14 +++++++------- faultplugin/registerdump.c | 2 +- faultplugin/singlestep.c | 8 ++++---- faultplugin/singlestep.h | 8 ++++---- faultplugin/tb_exec_data_collection.c | 4 ++-- faultplugin/tb_exec_data_collection.h | 5 ++--- faultplugin/tb_info_data_collection.c | 8 ++++---- faultplugin/tb_info_data_collection.h | 6 +++--- 10 files changed, 33 insertions(+), 34 deletions(-) diff --git a/faultplugin/fault_list.c b/faultplugin/fault_list.c index c512550..7906f1f 100644 --- a/faultplugin/fault_list.c +++ b/faultplugin/fault_list.c @@ -25,7 +25,7 @@ fault_list_t *first_fault; -void init_fault_list() +void init_fault_list(void) { first_fault = NULL; } @@ -85,7 +85,7 @@ int add_fault(uint64_t fault_address, uint64_t fault_type, uint64_t fault_model, * This function removes faults from linked list * */ -void delete_fault_queue() +void delete_fault_queue(void) { fault_list_t *del_item = NULL; while(first_fault != NULL) @@ -102,7 +102,7 @@ void delete_fault_queue() * * This function exists to separate fault list management from the rest of the code base */ -fault_list_t* return_first_fault() +fault_list_t* return_first_fault(void) { return first_fault; } diff --git a/faultplugin/fault_list.h b/faultplugin/fault_list.h index 2da0f2b..cf871e5 100644 --- a/faultplugin/fault_list.h +++ b/faultplugin/fault_list.h @@ -52,7 +52,7 @@ typedef struct fault_list_t -void init_fault_list(); +void init_fault_list(void); /** * add fault @@ -79,14 +79,14 @@ int add_fault(uint64_t fault_address, uint64_t fault_type, uint64_t fault_model, * This function removes faults from linked list * */ -void delete_fault_queue(); +void delete_fault_queue(void); /** * return_first_fault * * This function exists to separate fault list management from the rest of the code base */ -fault_list_t* return_first_fault(); +fault_list_t* return_first_fault(void); /** * return_next diff --git a/faultplugin/faultplugin.c b/faultplugin/faultplugin.c index 46617a2..9bad272 100644 --- a/faultplugin/faultplugin.c +++ b/faultplugin/faultplugin.c @@ -140,7 +140,7 @@ static void free_end_point_list(struct end_point_t *list) * This function deletes all mem info elements in the global linked list mem_info_list. * Furthermore it deletes the associated avl tree */ -void mem_info_free() +void mem_info_free(void) { mem_info_t *item; while(mem_info_list != NULL) @@ -346,7 +346,7 @@ void print_assembler(struct qemu_plugin_tb *tb) * */ -int qemu_setup_config() +int qemu_setup_config(void) { g_autoptr(GString) out = g_string_new(""); g_string_printf(out, "[Info]: Start readout of FIFO\n"); @@ -422,7 +422,7 @@ int qemu_setup_config() * * This function will fill the global fault trigger address array and fault address array */ -int register_fault_trigger_addresses() +int register_fault_trigger_addresses(void) { g_autoptr(GString) out = g_string_new(""); g_string_printf(out, "[Info]: Calculate number of faults ......."); @@ -480,7 +480,7 @@ void invalidate_fault_trigger_address(int fault_trigger_number) * * delete the vector containing the fault triggers */ -void delete_fault_trigger_addresses() +void delete_fault_trigger_addresses(void) { free(fault_trigger_addresses); } @@ -518,7 +518,7 @@ int register_live_faults_callback(fault_list_t *fault) * This function is called in the first used tb block * This function is maybe a TODO */ -void handle_first_tb_fault_insertion() +void handle_first_tb_fault_insertion(void) { g_autoptr(GString) out = g_string_new(""); @@ -721,7 +721,7 @@ int plugin_write_to_data_pipe(char *str, size_t len) } -size_t get_mem_info_list_size() +size_t get_mem_info_list_size(void) { size_t size = 0; mem_info_t *item = mem_info_list; @@ -1158,7 +1158,7 @@ int readout_pipe(uint8_t** protobuf_msg_buff, int pipe_fd) } -int readout_control_qemu() +int readout_control_qemu(void) { uint8_t* control_msg_buff; int msg_size = readout_pipe(&control_msg_buff, pipes->control); diff --git a/faultplugin/registerdump.c b/faultplugin/registerdump.c index a537199..c37c417 100644 --- a/faultplugin/registerdump.c +++ b/faultplugin/registerdump.c @@ -132,7 +132,7 @@ void readout_arm_registers(registerdump_t * current) current->regs[16] = qemu_plugin_read_reg(25); } -size_t get_register_dump_count() +size_t get_register_dump_count(void) { size_t size = 0; registerdump_t* current = first_registerdump; diff --git a/faultplugin/singlestep.c b/faultplugin/singlestep.c index 43dd141..1ee7aa6 100644 --- a/faultplugin/singlestep.c +++ b/faultplugin/singlestep.c @@ -27,12 +27,12 @@ volatile uint64_t req_singlestep = 0; -void init_singlestep_req() +void init_singlestep_req(void) { req_singlestep = 0; } -void check_singlestep() +void check_singlestep(void) { if(req_singlestep == 0) { @@ -45,7 +45,7 @@ void check_singlestep() qemu_plugin_flush_tb(); } -void add_singlestep_req() +void add_singlestep_req(void) { g_autoptr(GString) out = g_string_new(""); qemu_plugin_outs("[SINGLESTEP]: increase request\n"); @@ -55,7 +55,7 @@ void add_singlestep_req() check_singlestep(); } -void rem_singlestep_req() +void rem_singlestep_req(void) { if(req_singlestep != 0) { diff --git a/faultplugin/singlestep.h b/faultplugin/singlestep.h index 4b5c9b9..7d3c95e 100644 --- a/faultplugin/singlestep.h +++ b/faultplugin/singlestep.h @@ -26,26 +26,26 @@ * * Init singlestep module. This will initialise all needed variables */ -void init_singlestep_req(); +void init_singlestep_req(void); /** * check_singlestep * * Check weather singlestepping should be enabled or not. It will disable singlestep if no requests are open. If requests are open it will force qemu into singlestep. */ -void check_singlestep(); +void check_singlestep(void); /** * add_singlestep_req * * Increase counter for requested singlesteps. This function should be called, if singlestep should be enabled. It will internally call check_singlestep */ -void add_singlestep_req(); +void add_singlestep_req(void); /** * rem_singlestep_req * * decrease counter for request singlestep. This function should be called, if singlestep should be disabled or is no longer needed. */ -void rem_singlestep_req(); +void rem_singlestep_req(void); #endif diff --git a/faultplugin/tb_exec_data_collection.c b/faultplugin/tb_exec_data_collection.c index 2061567..5fdcad2 100644 --- a/faultplugin/tb_exec_data_collection.c +++ b/faultplugin/tb_exec_data_collection.c @@ -38,7 +38,7 @@ struct tb_exec_rb_element { struct tb_exec_rb_element *tb_exec_rb_list = NULL; int tb_exec_rb_list_index; -int tb_exec_order_init() +int tb_exec_order_init(void) { // List of execution order of tbs. tb_exec_order_list = NULL; @@ -65,7 +65,7 @@ int tb_exec_order_init() * Free linked list of tb_exec_order_t elements. It does not free the tb_info_t inside. * These must be freed separately with tb_info_free() */ -void tb_exec_order_free() +void tb_exec_order_free(void) { tb_exec_order_t *item; while(tb_exec_order_list != NULL) diff --git a/faultplugin/tb_exec_data_collection.h b/faultplugin/tb_exec_data_collection.h index 9977684..b58568f 100644 --- a/faultplugin/tb_exec_data_collection.h +++ b/faultplugin/tb_exec_data_collection.h @@ -33,8 +33,7 @@ typedef struct tb_exec_order_t tb_exec_order_t *next; }tb_exec_order_t; - -int tb_exec_order_init(); +int tb_exec_order_init(void); /** * tb_exec_order_free() @@ -42,7 +41,7 @@ int tb_exec_order_init(); * Free linked list of tb_exec_order_t elements. It does not free the tb_info_t inside. * These must be freed separately with tb_info_free() */ -void tb_exec_order_free(); +void tb_exec_order_free(void); /** * plugin_dump_tb_exec_order diff --git a/faultplugin/tb_info_data_collection.c b/faultplugin/tb_info_data_collection.c index c7bbcbc..31f7b66 100644 --- a/faultplugin/tb_info_data_collection.c +++ b/faultplugin/tb_info_data_collection.c @@ -27,14 +27,14 @@ tb_info_t *tb_info_list; /* AVL global variables */ struct avl_table *tb_avl_root; -void tb_info_init() +void tb_info_init(void) { // Linked list of tb structs inside tb. Used to delete them. tb_info_list = NULL; tb_avl_root = NULL; } -int tb_info_avl_init() +int tb_info_avl_init(void) { // AVL tree used in collecting data. This contains the tbs info of all generated tbs. // The id of a tb is its base address @@ -53,7 +53,7 @@ int tb_info_avl_init() * Function to delete the translation block information * structs from memory. Also deletes the avl tree */ -void tb_info_free() +void tb_info_free(void) { tb_info_t *item; while(tb_info_list != NULL) @@ -95,7 +95,7 @@ int tb_comparison_func(const void *tbl_a, const void *tbl_b, void * tbl_param) else return 0; } -size_t get_tb_info_list_size() +size_t get_tb_info_list_size(void) { tb_info_t *item = tb_info_list; size_t size = 0; diff --git a/faultplugin/tb_info_data_collection.h b/faultplugin/tb_info_data_collection.h index bb1c7a5..e50d115 100644 --- a/faultplugin/tb_info_data_collection.h +++ b/faultplugin/tb_info_data_collection.h @@ -44,14 +44,14 @@ typedef struct tb_info_t * * This function initialises all global variables used in module */ -void tb_info_init(); +void tb_info_init(void); /** * tb_info_avl_init() * * function initialises avl tree for tb info */ -int tb_info_avl_init(); +int tb_info_avl_init(void); /** * tb_info_free() @@ -59,7 +59,7 @@ int tb_info_avl_init(); * function to delete the translation block information * structs from memory. Also deletes the avl tree */ -void tb_info_free(); +void tb_info_free(void); /** * tb_comparison_func