xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Joshua Otto <jtotto@uwaterloo.ca>
Cc: ian.campbell@citrix.com, andrew.cooper3@citrix.com,
	czylin@uwaterloo.ca, xen-devel@lists.xen.org,
	Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	hjarmstr@uwaterloo.ca
Subject: Re: [PATCH] svm: rephrase local variable use for Coverity.
Date: Wed, 6 Jan 2016 09:33:26 -0500	[thread overview]
Message-ID: <568D25B6.7020701@oracle.com> (raw)
In-Reply-To: <568D23AF02000078000C3F2F@prv-mh.provo.novell.com>

On 01/06/2016 08:24 AM, Jan Beulich wrote:
>>>> On 01.01.16 at 04:14, <jtotto@uwaterloo.ca> wrote:
>> Coverity CID 1343310
>>
>> No functional changes.
>>
>> Signed-off-by: Joshua Otto <jtotto@uwaterloo.ca>
>> ---
>> On Mon, Dec 28, 2015 at 09:34:28AM +0000, Andrew Cooper wrote:
>>> The error message isn't fantastic, but the complaint that Coverity
>>> has is that we store intr here, then unilaterally store it again
>>> slightly lower in the function, no matter what value it had (with
>>> the early return presumably not being taken into account).
>>>
>>> The error would probably be resolved if lines 95 and 96 turned into
>>> "if ( vmcb_get_vintr(gvmcb).fields.irq )"
>> This patch implements that change - as a general rule, is maintainer
>> preference to resolve false positives like this by suppressing them in
>> the tool or through code changes like this one?

I'd rather suppress this in the tool as I am one of those people that 
Jan refers to below ;-)

However, if it's too much of a hassle then this patch would be OK.

-boris

> Asking such a question it would be helpful if you included the
> maintainers of the code in question, since to a good part this
> is a matter of taste, especially when ...
>
>> --- a/xen/arch/x86/hvm/svm/intr.c
>> +++ b/xen/arch/x86/hvm/svm/intr.c
>> @@ -92,8 +92,7 @@ static void svm_enable_intr_window(struct vcpu *v, struct hvm_intack intack)
>>                * return here or l2 guest looses interrupts, otherwise.
>>                */
>>               ASSERT(gvmcb != NULL);
>> -            intr = vmcb_get_vintr(gvmcb);
>> -            if ( intr.fields.irq )
>> +            if ( vmcb_get_vintr(gvmcb).fields.irq )
> ... some people (not me) frown upon complex expressions like the
> one resulting here.
>
> Also please note that while perhaps minor here, obvious with
> the quote from an earlier mail conversation, naming the person
> having suggested the change would be appropriate - if you
> look for them, you'll find quite a few Suggested-by: tags in the
> commit history.
>
> Jan
>

      reply	other threads:[~2016-01-06 14:33 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 20:26 Taking on a Xen development project jtotto
2015-12-10 10:59 ` Wei Liu
2015-12-10 17:23 ` Andrew Cooper
2015-12-12  2:19   ` Yang Hongyang
2015-12-12 22:30     ` Joshua Otto
2015-12-12 23:02       ` Andrew Cooper
2015-12-14 22:49         ` Joshua Otto
2015-12-11 13:52 ` Ian Campbell
2015-12-12 22:07   ` Joshua Otto
2015-12-14 11:08     ` Ian Campbell
2015-12-14 22:59       ` Joshua Otto
2015-12-15 15:48         ` Ian Campbell
2015-12-28  5:16       ` Coverity tidying Joshua Otto
2015-12-28  5:16         ` [PATCH 1/5] libxl: tidy libxl_get_scheduler() according to CODING_STYLE Joshua Otto
2016-01-04 16:23           ` Ian Campbell
2016-01-05  8:20             ` Dario Faggioli
2016-01-19  5:57               ` [PATCH v2 " Chester Lin
2016-01-19  9:14                 ` Dario Faggioli
2016-01-19 11:28                 ` Wei Liu
2016-01-19 11:35                   ` Ian Campbell
2015-12-28  5:16         ` [PATCH 2/5] libxl: make GC_FREE reachable in libxl_get_scheduler() Joshua Otto
2016-01-04 16:29           ` Ian Campbell
2016-01-05  8:49             ` Dario Faggioli
2016-01-05 11:16               ` Ian Campbell
2016-01-19  5:57                 ` [PATCH v2 " Chester Lin
2016-01-19  9:08                   ` Dario Faggioli
2016-01-19 14:15                   ` Ian Jackson
2015-12-28  5:16         ` [PATCH 3/5] ns16550: widen an integer constant for Coverity Joshua Otto
2016-01-04 16:36           ` Ian Campbell
2016-01-06  9:26             ` Jan Beulich
2016-01-19  5:57               ` [PATCH v2 3/5] n16550: add sanity check for reg_shift Chester Lin
2016-01-19 13:32                 ` Jan Beulich
2016-01-25  0:41                   ` czylin
2015-12-28  5:16         ` [PATCH 4/5] credit: remove pointless local variable initialization Joshua Otto
2015-12-28  5:16         ` [PATCH 5/5] libxl: Add explicit cast to libxl_psr_cat_set_cbm Joshua Otto
2016-01-04 16:40           ` Ian Campbell
2016-01-19  5:58             ` [PATCH v2 " Chester Lin
2016-01-19  8:34               ` Dario Faggioli
2016-01-19 14:06               ` Ian Jackson
2016-01-19 14:21                 ` Ian Campbell
2016-01-19 14:28                   ` Dario Faggioli
2016-01-19 14:33                     ` Ian Jackson
2016-01-19 14:31                   ` George Dunlap
2016-01-19 14:31                 ` Ian Campbell
2016-01-19 14:35                   ` Ian Jackson
2017-01-12 18:08                     ` George Dunlap
2017-01-13  9:05                       ` Dario Faggioli
2015-12-28  9:34         ` Coverity tidying Andrew Cooper
2016-01-01  3:14           ` [PATCH] svm: rephrase local variable use for Coverity Joshua Otto
2016-01-06 13:24             ` Jan Beulich
2016-01-06 14:33               ` Boris Ostrovsky [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=568D25B6.7020701@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=aravind.gopalakrishnan@amd.com \
    --cc=czylin@uwaterloo.ca \
    --cc=hjarmstr@uwaterloo.ca \
    --cc=ian.campbell@citrix.com \
    --cc=jtotto@uwaterloo.ca \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=xen-devel@lists.xen.org \
    /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).