qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	zhang.zhanghailiang@huawei.com, qemu-trivial@nongnu.org,
	Peter Lieven <pl@kamp.de>,
	qemu-devel@nongnu.org, Laurent Vivier <laurent@vivier.eu>,
	Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	Euler Robot <euler.robot@huawei.com>,
	Chen Qun <kuhn.chenqun@huawei.com>, Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH v3] block/iscsi:use the flags in iscsi_open() prevent Clang warning
Date: Fri, 20 Mar 2020 14:04:06 +0000	[thread overview]
Message-ID: <20200320140406.GA138042@stefanha-x1.localdomain> (raw)
In-Reply-To: <20200311032927.35092-1-kuhn.chenqun@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 1690 bytes --]

On Wed, Mar 11, 2020 at 11:29:27AM +0800, Chen Qun wrote:
> Clang static code analyzer show warning:
>   block/iscsi.c:1920:9: warning: Value stored to 'flags' is never read
>         flags &= ~BDRV_O_RDWR;
>         ^        ~~~~~~~~~~~~
> 
> In iscsi_allocmap_init() only checks BDRV_O_NOCACHE, which
> is the same in both of flags and bs->open_flags.
> We can use the flags instead bs->open_flags to prevent Clang warning.
> 
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
> Reviewed-by: Kevin Wolf <kwolf@redhat.com>

This can go via Paolo's SCSI tree.

> ---
> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Peter Lieven <pl@kamp.de>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Max Reitz <mreitz@redhat.com>
> Cc: Laurent Vivier <laurent@vivier.eu>
> 
> v1->v2:
>  Keep the 'flags' then use it(Base on Kevin's comments).
> 
> v2->v3:
>  Modify subject and commit messages(Base on Kevin's and Laurent's comments).
> ---
>  block/iscsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/iscsi.c b/block/iscsi.c
> index 682abd8e09..50bae51700 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -2002,7 +2002,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
>          iscsilun->cluster_size = iscsilun->bl.opt_unmap_gran *
>              iscsilun->block_size;
>          if (iscsilun->lbprz) {
> -            ret = iscsi_allocmap_init(iscsilun, bs->open_flags);
> +            ret = iscsi_allocmap_init(iscsilun, flags);
>          }
>      }
>  
> -- 
> 2.23.0
> 
> 
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2020-03-20 14:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11  3:29 [PATCH v3] block/iscsi:use the flags in iscsi_open() prevent Clang warning Chen Qun
2020-03-20  2:25 ` Chenqun (kuhn)
2020-03-20  9:20   ` Laurent Vivier
2020-03-20 14:04 ` Stefan Hajnoczi [this message]
2020-03-23 16:58 ` Kevin Wolf

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=20200320140406.GA138042@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=euler.robot@huawei.com \
    --cc=kuhn.chenqun@huawei.com \
    --cc=kwolf@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=ronniesahlberg@gmail.com \
    --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).