qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] hw: Disable code after return statement
Date: Fri, 5 Oct 2012 13:53:30 +0200	[thread overview]
Message-ID: <20121005115330.GA7068@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1348382492-8342-1-git-send-email-sw@weilnetz.de>

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 <sw@weilnetz.de>
> ---
>  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

      reply	other threads:[~2012-10-05 11:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-23  6:41 [Qemu-devel] [PATCH] hw: Disable code after return statement Stefan Weil
2012-10-05 11:53 ` Stefan Hajnoczi [this message]

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=20121005115330.GA7068@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=sw@weilnetz.de \
    /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 NNTP newsgroup(s).