From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TK6TI-0003cM-RX for qemu-devel@nongnu.org; Fri, 05 Oct 2012 07:53:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TK6TH-0002y8-4D for qemu-devel@nongnu.org; Fri, 05 Oct 2012 07:53:36 -0400 Date: Fri, 5 Oct 2012 13:53:30 +0200 From: Stefan Hajnoczi Message-ID: <20121005115330.GA7068@stefanha-thinkpad.redhat.com> References: <1348382492-8342-1-git-send-email-sw@weilnetz.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1348382492-8342-1-git-send-email-sw@weilnetz.de> Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] hw: Disable code after return statement List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org On Sun, Sep 23, 2012 at 08:41:32AM +0200, Stefan Weil wrote: > Report from smatch: > microdrive.c:212 md_common_read(34) info: ignoring unreachable code. > microdrive.c:273 md_common_write(33) info: ignoring unreachable code. > sd.c:343 sd_req_crc_validate(9) info: ignoring unreachable code. > > Signed-off-by: Stefan Weil > --- > hw/ide/microdrive.c | 3 ++- > hw/sd.c | 2 ++ > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c > index 64810f7..07c6f97 100644 > --- a/hw/ide/microdrive.c > +++ b/hw/ide/microdrive.c > @@ -207,7 +207,7 @@ static uint16_t md_common_read(void *opaque, uint32_t at) > case 0x0: /* Even RD Data */ > case 0x8: > return ide_data_readw(&s->bus, 0); > - > +#if 0 > /* TODO: 8-bit accesses */ > if (s->cycle) > ret = s->io >> 8; > @@ -217,6 +217,7 @@ static uint16_t md_common_read(void *opaque, uint32_t at) > } > s->cycle = !s->cycle; > return ret; > +#endif > case 0x9: /* Odd RD Data */ > return s->io >> 8; > case 0xd: /* Error */ > diff --git a/hw/sd.c b/hw/sd.c > index ec26407..62a7751 100644 > --- a/hw/sd.c > +++ b/hw/sd.c > @@ -340,7 +340,9 @@ static int sd_req_crc_validate(SDRequest *req) > buffer[3] = (req->arg >> 8) & 0xff; > buffer[4] = (req->arg >> 0) & 0xff; > return 0; > +#if 0 > return sd_crc7(buffer, 5) != req->crc; /* TODO */ > +#endif hw/sd.c:336:13: error: variable ‘buffer’ set but not used [-Werror=unused-but-set-variable] I suggest we drop this dead code completely instead of using #if 0. Stefan