[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] block/iscsi:use the flags in iscsi_open() prevent Clang w
From: |
Laurent Vivier |
Subject: |
Re: [PATCH v3] block/iscsi:use the flags in iscsi_open() prevent Clang warning |
Date: |
Fri, 20 Mar 2020 10:20:21 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
Le 20/03/2020 à 03:25, Chenqun (kuhn) a écrit :
> Gentle ping.
>
> Any other suggestions about this?
I will not take that via the trivial queue as it is not trivial for me.
Could it go via block queue?
Thanks,
Laurent
> Thanks.
>
>> -----Original Message-----
>> From: Chenqun (kuhn)
>> Sent: Wednesday, March 11, 2020 11:29 AM
>> To: address@hidden; address@hidden
>> Cc: Zhanghailiang <address@hidden>; Chenqun (kuhn)
>> <address@hidden>; Euler Robot <address@hidden>;
>> Kevin Wolf <address@hidden>; Ronnie Sahlberg
>> <address@hidden>; Paolo Bonzini <address@hidden>; Peter
>> Lieven <address@hidden>; Max Reitz <address@hidden>; Laurent Vivier
>> <address@hidden>
>> Subject: [PATCH v3] block/iscsi:use the flags in iscsi_open() prevent Clang
>> warning
>>
>> 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 <address@hidden>
>> Signed-off-by: Chen Qun <address@hidden>
>> Reviewed-by: Kevin Wolf <address@hidden>
>> ---
>> Cc: Ronnie Sahlberg <address@hidden>
>> Cc: Paolo Bonzini <address@hidden>
>> Cc: Peter Lieven <address@hidden>
>> Cc: Kevin Wolf <address@hidden>
>> Cc: Max Reitz <address@hidden>
>> Cc: Laurent Vivier <address@hidden>
>>
>> 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
>>
>