qemu-devel.nongnu.org archive mirror
 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: Fam Zheng <fam@euphon.net>,
	peter.maydell@linaro.org, Paolo Bonzini <pbonzini@redhat.com>,
	zhang.zhanghailiang@huawei.com,
	Euler Robot <euler.robot@huawei.com>
Subject: Re: [PATCH v3 05/12] scsi/scsi-disk: Remove redundant statement in scsi_disk_emulate_command()
Date: Mon, 9 Mar 2020 13:30:46 +0100	[thread overview]
Message-ID: <8354d3b7-d632-12fc-de79-e3fcae97c4fa@vivier.eu> (raw)
In-Reply-To: <20200302130715.29440-7-kuhn.chenqun@huawei.com>

Le 02/03/2020 à 14:07, Chen Qun a écrit :
> Clang static code analyzer show warning:
> scsi/scsi-disk.c:1918:5: warning: Value stored to 'buflen' is never read
>     buflen = req->cmd.xfer;
>     ^        ~~~~~~~~~~~~~
> 
> 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>
> ---
>  hw/scsi/scsi-disk.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index 10d0794d60..1c0cb63a6f 100644
> --- a/hw/scsi/scsi-disk.c
> +++ b/hw/scsi/scsi-disk.c
> @@ -1915,7 +1915,6 @@ static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
>          r->iov.iov_base = blk_blockalign(s->qdev.conf.blk, r->buflen);
>      }
>  
> -    buflen = req->cmd.xfer;
>      outbuf = r->iov.iov_base;
>      memset(outbuf, 0, r->buflen);
>      switch (req->cmd.buf[0]) {
> 

Fixes: c8dcb531bcd3 ("scsi: do not return short responses for emulated
commands")
Reviewed-by: Laurent Vivier <laurent@vivier.eu>


  reply	other threads:[~2020-03-09 12:48 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-02 13:07 [PATCH v3 00/12] redundant code: Fix warnings reported by Clang static code analyzer Chen Qun
2020-03-02 13:07 ` Chen Qun
2020-03-02 13:07 ` [PATCH v3 01/12] block/stream: Remove redundant statement in stream_run() Chen Qun
2020-03-09 12:13   ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 02/12] block/iscsi:Remove redundant statement in iscsi_open() Chen Qun
2020-03-10 14:26   ` Kevin Wolf
2020-03-10 15:02     ` Laurent Vivier
2020-03-11  2:04       ` Chenqun (kuhn)
2020-03-02 13:07 ` [PATCH v3 03/12] block/file-posix: Remove redundant statement in raw_handle_perm_lock() Chen Qun
2020-03-09 12:18   ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 04/12] scsi/esp-pci: Remove redundant statement in esp_pci_io_write() Chen Qun
2020-03-09 12:21   ` Laurent Vivier
2020-03-10 11:52     ` Chenqun (kuhn)
2020-03-10 13:00       ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 05/12] scsi/scsi-disk: Remove redundant statement in scsi_disk_emulate_command() Chen Qun
2020-03-09 12:30   ` Laurent Vivier [this message]
2020-03-09 12:52   ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 06/12] display/pxa2xx_lcd: Remove redundant statement in pxa2xx_palette_parse() Chen Qun
2020-03-09 12:32   ` Laurent Vivier
2020-03-09 12:53   ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 07/12] display/exynos4210_fimd: Remove redundant statement in exynos4210_fimd_update() Chen Qun
2020-03-09 12:35   ` Laurent Vivier
2020-03-09 12:54   ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 08/12] display/blizzard: Remove redundant statement in blizzard_draw_line16_32() Chen Qun
2020-03-02 13:07 ` [PATCH v3 09/12] dma/xlnx-zdma: Remove redundant statement in zdma_write_dst() Chen Qun
2020-03-02 14:19   ` Edgar E. Iglesias
2020-03-09 12:38   ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 10/12] timer/exynos4210_mct: Remove redundant statement in exynos4210_mct_write() Chen Qun
2020-03-02 13:07 ` [PATCH v3 11/12] usb/hcd-ehci: Remove redundant statements Chen Qun
2020-03-03 10:28   ` Gerd Hoffmann
2020-03-09 12:42   ` Laurent Vivier
2020-03-09 12:52     ` Chenqun (kuhn)
2020-03-09 12:55       ` Laurent Vivier
2020-03-02 13:07 ` [PATCH v3 12/12] monitor/hmp-cmds: Remove redundant statement in hmp_rocker_of_dpa_groups() Chen Qun
2020-03-09 12:50   ` Laurent Vivier
2020-03-09 12:58   ` 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=8354d3b7-d632-12fc-de79-e3fcae97c4fa@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=euler.robot@huawei.com \
    --cc=fam@euphon.net \
    --cc=kuhn.chenqun@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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 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).