public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 06/17] sim: erc32: fix -Wunused-but-set-variable warnings
Date: Wed,  6 Dec 2023 20:59:26 -0700	[thread overview]
Message-ID: <20231207035937.14920-6-vapier@gentoo.org> (raw)
In-Reply-To: <20231207035937.14920-1-vapier@gentoo.org>

---
 sim/erc32/erc32.c |  8 ++------
 sim/erc32/func.c  | 11 ++---------
 2 files changed, 4 insertions(+), 15 deletions(-)

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) {
-- 
2.43.0


  parent reply	other threads:[~2023-12-07  3:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07  3:59 [PATCH 01/17] sim: arm: " Mike Frysinger
2023-12-07  3:59 ` [PATCH 02/17] sim: bfin: gui: " Mike Frysinger
2023-12-07  3:59 ` [PATCH 03/17] sim: bfin: " Mike Frysinger
2023-12-07  3:59 ` [PATCH 04/17] sim: cris: " Mike Frysinger
2023-12-07  3:59 ` [PATCH 05/17] sim: d10v: " Mike Frysinger
2023-12-07  3:59 ` Mike Frysinger [this message]
2023-12-07  3:59 ` [PATCH 07/17] sim: frv: " Mike Frysinger
2023-12-07  3:59 ` [PATCH 08/17] sim: ft32: " Mike Frysinger
2023-12-07  3:59 ` [PATCH 09/17] sim: h8300: " Mike Frysinger
2023-12-07  3:59 ` [PATCH 10/17] sim: m68hc11: " Mike Frysinger
2023-12-07  3:59 ` [PATCH 11/17] sim: mcore: " Mike Frysinger
2023-12-07  3:59 ` [PATCH 12/17] sim: mips: " Mike Frysinger
2023-12-07  3:59 ` [PATCH 13/17] sim: mn10300: " Mike Frysinger
2023-12-07  3:59 ` [PATCH 14/17] sim: msp430: " Mike Frysinger
2023-12-07  3:59 ` [PATCH 15/17] sim: sh: " Mike Frysinger
2023-12-07  3:59 ` [PATCH 16/17] sim: v850: " Mike Frysinger
2023-12-07  3:59 ` [PATCH 17/17] sim: warnings: enable -Wunused-but-set-variable Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231207035937.14920-6-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).