>-----Original Message----- >From: Kevin Wolf [mailto:[email protected]] >Sent: Wednesday, February 26, 2020 5:55 PM >To: Chenqun (kuhn) <[email protected]> >Cc: [email protected]; [email protected]; >[email protected]; Zhanghailiang <[email protected]>; >Euler Robot <[email protected]>; Ronnie Sahlberg ><[email protected]>; Paolo Bonzini <[email protected]>; Peter >Lieven <[email protected]>; Max Reitz <[email protected]> >Subject: Re: [PATCH v2 02/13] block/iscsi:Remove redundant statement in >iscsi_open() > >Am 26.02.2020 um 09:46 hat [email protected] geschrieben: >> From: Chen Qun <[email protected]> >> >> Clang static code analyzer show warning: >> block/iscsi.c:1920:9: warning: Value stored to 'flags' is never read >> flags &= ~BDRV_O_RDWR; >> ^ ~~~~~~~~~~~~ >> >> Reported-by: Euler Robot <[email protected]> >> Signed-off-by: Chen Qun <[email protected]> > >Hmm, I'm not so sure about this one because if we remove the line, flags will >be inconsistent with bs->open_flags. It feels like setting a trap for anyone >who wants to add code using flags in the future. Hi Kevin, I find it exists since 8f3bf50d34037266. : ) It's not a big deal, just upset clang static code analyzer. As you said, it could be a trap for the future.
It ’s okay, whether it exists or not. Thanks. > >Kevin > >> Cc: Ronnie Sahlberg <[email protected]> >> Cc: Paolo Bonzini <[email protected]> >> Cc: Peter Lieven <[email protected]> >> Cc: Kevin Wolf <[email protected]> >> Cc: Max Reitz <[email protected]> >> --- >> block/iscsi.c | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/block/iscsi.c b/block/iscsi.c index >> 682abd8e09..ed88479ede 100644 >> --- a/block/iscsi.c >> +++ b/block/iscsi.c >> @@ -1917,7 +1917,6 @@ static int iscsi_open(BlockDriverState *bs, QDict >*options, int flags, >> if (ret < 0) { >> goto out; >> } >> - flags &= ~BDRV_O_RDWR; >> } >> >> iscsi_readcapacity_sync(iscsilun, &local_err); >> -- >> 2.23.0 >> >>
