From 592cb9e9cc97417548728d9e2ba524337a757c16 Mon Sep 17 00:00:00 2001 From: Julian Uy Date: Fri, 22 Mar 2024 23:30:18 -0500 Subject: [PATCH] fix: [loadfile] fix instances of -Wunused-parameter --- iop/system/loadfile/src/eeelfloader.c | 6 ++++++ iop/system/loadfile/src/loadfile.c | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/iop/system/loadfile/src/eeelfloader.c b/iop/system/loadfile/src/eeelfloader.c index cd9fadfa32c..09dfa922b6e 100644 --- a/iop/system/loadfile/src/eeelfloader.c +++ b/iop/system/loadfile/src/eeelfloader.c @@ -22,6 +22,8 @@ static int *allocate_heap_buffer(unsigned int lower_bound, unsigned int upper_bo { unsigned int upper_bound_rounded; + (void)lower_bound; + upper_bound_rounded = upper_bound; // Align to 4 bytes if ( (upper_bound_rounded & 3) != 0 ) @@ -306,6 +308,8 @@ static int fileio_reader_function(int fd, loadfile_allocate_handler_struct_t *al loadfile_ee_elf_ringbuffer_content_t *rbc; int read_res; + (void)userdata; + read_buffer_offset = allocate_info->read_buffer_offset; rbc = &allocate_info->ring_buffer_contents[allocate_info->ring_buffer_index]; rbc->buffer_offset = read_buffer_offset; @@ -415,6 +419,8 @@ static int elf_load_single_section( SifDmaTransfer_t dmat; int state; + (void)epc; + shdr = NULL; if ( read(flhs->fd, &flhs->elf_header, 0x34) != 0x34 ) { diff --git a/iop/system/loadfile/src/loadfile.c b/iop/system/loadfile/src/loadfile.c index 760da87ecae..ff18645dde3 100644 --- a/iop/system/loadfile/src/loadfile.c +++ b/iop/system/loadfile/src/loadfile.c @@ -26,6 +26,9 @@ int _start(int argc, char *argv[]) int thid; iop_thread_t thparam; + (void)argc; + (void)argv; + FlushDcache(); BootMode_3 = QueryBootMode(3); if ( BootMode_3 ) @@ -63,6 +66,8 @@ static int *loadfile_modload(const struct _lf_module_load_arg *in_packet, int le { const char *path; + (void)length; + path = in_packet->path; if ( IsIllegalBootDevice(path) ) { @@ -83,6 +88,8 @@ static int *loadfile_elfload(const struct _lf_elf_load_arg *in_packet, int lengt int result_out; int result_module_out; + (void)length; + path = in_packet->path; if ( IsIllegalBootDevice(path) ) { @@ -113,6 +120,8 @@ static int *loadfile_setaddr(const struct _lf_iop_val_arg *in_packet, int length void *iop_addr; int type; + (void)length; + iop_addr = (void *)in_packet->p.iop_addr; type = in_packet->type; printf("set val add %p type %x ", iop_addr, type); @@ -139,6 +148,8 @@ static int *loadfile_getaddr(const struct _lf_iop_val_arg *in_packet, int length void *iop_addr; int type; + (void)length; + iop_addr = (void *)in_packet->p.iop_addr; type = in_packet->type; printf("get val add %p type %x ", iop_addr, type); @@ -162,6 +173,8 @@ static int *loadfile_getaddr(const struct _lf_iop_val_arg *in_packet, int length static int *loadfile_mg_modload(const struct _lf_module_load_arg *in_packet, int length, int *outbuffer) { + (void)length; + outbuffer[0] = LoadStartKelfModule(in_packet->path, in_packet->p.arg_len, in_packet->args, &outbuffer[1]); return outbuffer; } @@ -171,6 +184,8 @@ static int *loadfile_mg_elfload(const struct _lf_elf_load_arg *in_packet, int le int result_out; int result_module_out; + (void)length; + outbuffer[0] = loadfile_mg_elfload_proc(in_packet->path, in_packet->epc, in_packet->secname, &result_out, &result_module_out); if ( outbuffer[0] >= 0 ) @@ -191,6 +206,8 @@ static int *loadfile_loadmodulebuffer(const struct _lf_module_buffer_load_arg *i { int ModuleBuffer; + (void)length; + printf("loadbuffer: addrres %x args %d arg %s\n", in_packet->p.result, in_packet->q.arg_len, in_packet->args); ModuleBuffer = LoadModuleBuffer(in_packet->p.ptr); if ( ModuleBuffer >= 0 )