All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Chen Qun <kuhn.chenqun@huawei.com>,
	qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	philmd@redhat.com, zhang.zhanghailiang@huawei.com,
	Euler Robot <euler.robot@huawei.com>
Subject: Re: [PATCH v4 1/3] scsi/esp-pci: Remove redundant statement in esp_pci_io_write()
Date: Tue, 24 Mar 2020 09:27:52 +0100	[thread overview]
Message-ID: <0179e5e1-9879-6aca-2f5c-8ed46169c7d9@vivier.eu> (raw)
In-Reply-To: <20200324082235.27980-2-kuhn.chenqun@huawei.com>

Le 24/03/2020 à 09:22, Chen Qun a écrit :
> Clang static code analyzer show warning:
>   hw/scsi/esp-pci.c:198:9: warning: Value stored to 'size' is never read
>         size = 4;
>         ^      ~
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> ---
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc:Fam Zheng <fam@euphon.net>
> v1->v2:
> keep ' size = 4'  and  add 'g_assert(size >= 4)' after if() statement.
> (Base on Laurent's comments)
> ---
>  hw/scsi/esp-pci.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
> index d5a1f9e017..497a8d5901 100644
> --- a/hw/scsi/esp-pci.c
> +++ b/hw/scsi/esp-pci.c
> @@ -197,6 +197,7 @@ static void esp_pci_io_write(void *opaque, hwaddr addr,
>          addr &= ~3;
>          size = 4;
>      }
> +    g_assert(size >= 4);
>  
>      if (addr < 0x40) {
>          /* SCSI core reg */
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>


  reply	other threads:[~2020-03-24  8:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24  8:22 [PATCH v4 0/3] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
2020-03-24  8:22 ` [PATCH v4 1/3] scsi/esp-pci: Remove redundant statement in esp_pci_io_write() Chen Qun
2020-03-24  8:27   ` Laurent Vivier [this message]
2020-03-24  8:22 ` [PATCH v4 2/3] display/blizzard: Remove redundant statement in blizzard_draw_line16_32() Chen Qun
2020-03-24  8:38   ` Laurent Vivier
2020-03-24  8:40     ` Laurent Vivier
2020-03-24 11:49       ` Chenqun (kuhn)
2020-03-24  8:22 ` [PATCH v4 3/3] timer/exynos4210_mct: Remove redundant statement in exynos4210_mct_write() Chen Qun
2020-03-24 10:59   ` Laurent Vivier
2020-03-24 12:22     ` Chenqun (kuhn)
2020-03-24 13:21       ` Laurent Vivier

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=0179e5e1-9879-6aca-2f5c-8ed46169c7d9@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=euler.robot@huawei.com \
    --cc=kuhn.chenqun@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.