qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, vsementsov@virtuozzo.com,
	"open list:Network Block Dev..." <qemu-block@nongnu.org>
Subject: Re: [PATCH for-5.2?] nbd: Silence Coverity false positive
Date: Thu, 12 Nov 2020 13:18:03 -0800	[thread overview]
Message-ID: <47d8ce8b-9db3-b0b2-c25a-e6418e67edd6@linaro.org> (raw)
In-Reply-To: <f7d1ebf0-0a7b-3546-d07d-57fda470a59e@redhat.com>

On 11/12/20 1:09 PM, Eric Blake wrote:
> On 11/12/20 3:04 PM, Richard Henderson wrote:
>> On 11/11/20 8:35 AM, Eric Blake wrote:
>>> -    if (!full) {
>>> -        /* last non dirty extent */
>>> -        nbd_extent_array_add(es, end - start, 0);
>>> +    if (!full && nbd_extent_array_add(es, end - start, 0) < 0) {
>>> +        /* last non dirty extent, nothing to do if array was already full */
>>>      }
>>
>> Casting to (void) is another way to get rid of the warning.
>>
>> I dunno which makes more sense here.  Definitely the comment is helpful.
> 
> As in:
> 
> if (!full) {
>     /* last non dirty extent, nothing to do if array is now full */
>     (void) nbd_extent_array_add(es, end - start, 0);
> }

Yep.

> Yeah, that looks a little better.  Should I post that as v2, or wait for
> further comments on this?

Up to you.  You can have my
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
for either version.


r~



      reply	other threads:[~2020-11-12 21:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11 16:35 [PATCH for-5.2?] nbd: Silence Coverity false positive Eric Blake
2020-11-12 21:04 ` Richard Henderson
2020-11-12 21:09   ` Eric Blake
2020-11-12 21:18     ` Richard Henderson [this message]

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=47d8ce8b-9db3-b0b2-c25a-e6418e67edd6@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=eblake@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.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).