From aa7f93f837ecaf335ae90e3f17c70ee6d4bb4f65 Mon Sep 17 00:00:00 2001 From: uyjulian Date: Fri, 11 Jun 2021 09:31:31 -0500 Subject: [PATCH] Avoid unused variable --- modules/debug/ps2link/cmdHandler.c | 40 ++++++++-------------------- modules/iopcore/cdvdman/cdvdman.c | 5 ++-- modules/iopcore/cdvdman/hdpro_atad.c | 5 ++-- modules/mcemu/mcemu_rpc.c | 2 +- 4 files changed, 16 insertions(+), 36 deletions(-) diff --git a/modules/debug/ps2link/cmdHandler.c b/modules/debug/ps2link/cmdHandler.c index 8d0796723..af7445d18 100644 --- a/modules/debug/ps2link/cmdHandler.c +++ b/modules/debug/ps2link/cmdHandler.c @@ -52,7 +52,6 @@ pkoExecIop(char *buf, int len) pko_pkt_execiop_req *cmd; int retval; int arglen; - char *path; char *args; unsigned int argc; int id; @@ -72,7 +71,6 @@ pkoExecIop(char *buf, int len) printf("IOP cmd: %ld args\n", ntohl(cmd->argc)); - path = &cmd->argv[0]; args = &cmd->argv[strlen(cmd->argv) + 1]; argc = ntohl(cmd->argc); @@ -161,33 +159,25 @@ pkoSendSifCmd(unsigned int cmd, void *src, unsigned int len) static void pkoExecEE(char *buf, int len) { - int ret; - - ret = pkoSendSifCmd(PKO_RPC_EXECEE, buf, len); + pkoSendSifCmd(PKO_RPC_EXECEE, buf, len); }; ////////////////////////////////////////////////////////////////////////// static void pkoGSExec(char *buf, int len) { - int ret; - - ret = pkoSendSifCmd(PKO_RPC_GSEXEC, buf, len); + pkoSendSifCmd(PKO_RPC_GSEXEC, buf, len); }; ////////////////////////////////////////////////////////////////////////// static void pkoNetDump(char *buf, int len) { - int ret; - - ret = pkoSendSifCmd(PKO_RPC_NETDUMP, buf, len); + pkoSendSifCmd(PKO_RPC_NETDUMP, buf, len); }; ////////////////////////////////////////////////////////////////////////// static void pkoScrDump(char *buf, int len) { - int ret; - - ret = pkoSendSifCmd(PKO_RPC_SCRDUMP, buf, len); + pkoSendSifCmd(PKO_RPC_SCRDUMP, buf, len); }; ////////////////////////////////////////////////////////////////////////// @@ -201,8 +191,6 @@ pkoPowerOff() static void pkoReset(char *buf, int len) { - int ret; - dbgprintf("IOP cmd: RESET\n"); if (len != sizeof(pko_pkt_reset_req)) { @@ -215,43 +203,37 @@ pkoReset(char *buf, int len) printf("unmounted\n"); DelDrv("tty"); - ret = pkoSendSifCmd(PKO_RPC_RESET, buf, len); + pkoSendSifCmd(PKO_RPC_RESET, buf, len); }; static void pkoStopVU(char *buf, int len) { - int ret; - - ret = pkoSendSifCmd(PKO_RPC_STOPVU, buf, len); + pkoSendSifCmd(PKO_RPC_STOPVU, buf, len); }; static void pkoStartVU(char *buf, int len) { - int ret; - ret = pkoSendSifCmd(PKO_RPC_STARTVU, buf, len); + pkoSendSifCmd(PKO_RPC_STARTVU, buf, len); }; static void pkoDumpMem(char *buf, int len) { - int ret; - ret = pkoSendSifCmd(PKO_RPC_DUMPMEM, buf, len); + pkoSendSifCmd(PKO_RPC_DUMPMEM, buf, len); }; static void pkoDumpReg(char *buf, int len) { - int ret; - ret = pkoSendSifCmd(PKO_RPC_DUMPREG, buf, len); + pkoSendSifCmd(PKO_RPC_DUMPREG, buf, len); }; static void pkoWriteMem(char *buf, int len) { - int ret; - ret = pkoSendSifCmd(PKO_RPC_WRITEMEM, buf, len); + pkoSendSifCmd(PKO_RPC_WRITEMEM, buf, len); }; ////////////////////////////////////////////////////////////////////////// @@ -344,7 +326,7 @@ cmdPowerOff(void *arg) reset.cmd = htonl(PKO_RESET_CMD); reset.len = 0; - pkoReset((unsigned char *)&reset, sizeof(reset)); + pkoReset((char *)&reset, sizeof(reset)); #endif } diff --git a/modules/iopcore/cdvdman/cdvdman.c b/modules/iopcore/cdvdman/cdvdman.c index 3d37d7581..22062e2a1 100644 --- a/modules/iopcore/cdvdman/cdvdman.c +++ b/modules/iopcore/cdvdman/cdvdman.c @@ -1674,7 +1674,6 @@ static int cdvdman_findfile(cd_file_t *pcdfile, const char *name, int layer) static int cdvdman_writeSCmd(u8 cmd, void *in, u32 in_size, void *out, u32 out_size) { int i; - u8 dummy; u8 *p; u8 rdbuf[64]; @@ -1687,7 +1686,7 @@ static int cdvdman_writeSCmd(u8 cmd, void *in, u32 in_size, void *out, u32 out_s if (!(CDVDreg_SDATAIN & 0x40)) { do { - dummy = CDVDreg_SDATAOUT; + (void)CDVDreg_SDATAOUT; } while (!(CDVDreg_SDATAIN & 0x40)); } @@ -1699,7 +1698,7 @@ static int cdvdman_writeSCmd(u8 cmd, void *in, u32 in_size, void *out, u32 out_s } CDVDreg_SCOMMAND = cmd; - dummy = CDVDreg_SCOMMAND; + (void)CDVDreg_SCOMMAND; while (CDVDreg_SDATAIN & 0x80) { ; diff --git a/modules/iopcore/cdvdman/hdpro_atad.c b/modules/iopcore/cdvdman/hdpro_atad.c index d645ce5ad..78d04536d 100644 --- a/modules/iopcore/cdvdman/hdpro_atad.c +++ b/modules/iopcore/cdvdman/hdpro_atad.c @@ -468,10 +468,9 @@ int ata_io_start(void *buf, u32 blkcount, u16 feature, u16 nsector, u16 sector, suspend_intr(); HDPROreg_IO8 = 0x21; CDVDreg_STATUS = 0; - unsigned int dummy = HDPROreg_IO8; + (void)HDPROreg_IO8; CDVDreg_STATUS = 0; resume_intr(); - dummy = 0; /* Finally! We send off the ATA command with arguments. */ hdpro_io_write(ATAreg_CONTROL_WR, (using_timeout == 0) << 1); @@ -712,7 +711,7 @@ int ata_device_sector_io(int device, void *buf, u32 lba, u32 nsectors, int dir) continue; nbytes = len * 512; - buf = (void *)((u8 *)buf + len * 512); + buf = (void *)((u8 *)buf + nbytes); lba += len; nsectors -= len; } diff --git a/modules/mcemu/mcemu_rpc.c b/modules/mcemu/mcemu_rpc.c index 660331a4b..543cf54ae 100644 --- a/modules/mcemu/mcemu_rpc.c +++ b/modules/mcemu/mcemu_rpc.c @@ -58,7 +58,7 @@ int hookMcman63(int fd, u32 eeaddr, int nbyte) register int rlen; register int rval; register int size; - register u32 id; + register u32 id __attribute__((unused)); register char *rpcbuf, *fiobuf; SifRpcClientData_t *cldata;