[06/17] sim: erc32: fix -Wunused-but-set-variable warnings

Message ID 20231207035937.14920-6-vapier@gentoo.org
State New
Headers
Series [01/17] sim: arm: fix -Wunused-but-set-variable warnings |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Mike Frysinger Dec. 7, 2023, 3:59 a.m. UTC
  ---
 sim/erc32/erc32.c |  8 ++------
 sim/erc32/func.c  | 11 ++---------
 2 files changed, 4 insertions(+), 15 deletions(-)
  

Patch

diff --git a/sim/erc32/erc32.c b/sim/erc32/erc32.c
index ec72ae070a4b..32c45bddb680 100644
--- a/sim/erc32/erc32.c
+++ b/sim/erc32/erc32.c
@@ -1042,10 +1042,6 @@  port_init(void)
 static uint32_t
 read_uart(uint32_t addr)
 {
-
-    unsigned        tmp;
-
-    tmp = 0;
     switch (addr & 0xff) {
 
     case 0xE0:			/* UART 1 */
@@ -1071,7 +1067,7 @@  read_uart(uint32_t addr)
 
 	}
 #else
-	tmp = uarta_data;
+	unsigned tmp = uarta_data;
 	uarta_data &= ~UART_DR;
 	uart_stat_reg &= ~UARTA_DR;
 	return tmp;
@@ -1103,7 +1099,7 @@  read_uart(uint32_t addr)
 
 	}
 #else
-	tmp = uartb_data;
+	unsigned tmp = uartb_data;
 	uartb_data &= ~UART_DR;
 	uart_stat_reg &= ~UARTB_DR;
 	return tmp;
diff --git a/sim/erc32/func.c b/sim/erc32/func.c
index 85f71817dfdb..f1b230a8f918 100644
--- a/sim/erc32/func.c
+++ b/sim/erc32/func.c
@@ -687,11 +687,8 @@  int_handler(int32_t sig)
 void
 init_signals(void)
 {
-    typedef void    (*PFI) ();
-    static PFI      int_tab[2];
-
-    int_tab[0] = signal(SIGTERM, int_handler);
-    int_tab[1] = signal(SIGINT, int_handler);
+    signal(SIGTERM, int_handler);
+    signal(SIGINT, int_handler);
 }
 
 
@@ -706,7 +703,6 @@  disp_fpu(struct pstate *sregs)
 {
 
     int         i;
-    float	t;
 
     printf("\n fsr: %08X\n\n", sregs->fsr);
 
@@ -716,7 +712,6 @@  disp_fpu(struct pstate *sregs)
 #endif
 
     for (i = 0; i < 32; i++) {
-	t = sregs->fs[i];
 	printf(" f%02d  %08x  %14e  ", i, sregs->fsi[i], sregs->fs[i]);
 	if (!(i & 1))
 	    printf("%14e\n", sregs->fd[i >> 1]);
@@ -1006,7 +1001,6 @@  bfd_load (const char *fname)
 {
     asection       *section;
     bfd            *pbfd;
-    const bfd_arch_info_type *arch;
     int            i;
 
     pbfd = bfd_openr(fname, 0);
@@ -1020,7 +1014,6 @@  bfd_load (const char *fname)
 	return -1;
     }
 
-    arch = bfd_get_arch_info (pbfd);
     if (sis_verbose)
 	printf("loading %s:", fname);
     for (section = pbfd->sections; section; section = section->next) {