From: "Xu, Quan" <quan.xu@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] AMD IOMMU: correctly propagate errors from amd_iommu_init()
Date: Thu, 16 Jun 2016 08:57:09 +0000 [thread overview]
Message-ID: <945CA011AD5F084CBEA3E851C0AB28894B8E6745@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <57627F6302000078000F590D@prv-mh.provo.novell.com>
On June 16, 2016 4:29 PM, Jan Beulich <JBeulich@suse.com> wrote:
> >>> On 16.06.16 at 04:03, <quan.xu@intel.com> wrote:
> > On June 14, 2016 5:03 PM, Jan Beulich <JBeulich@suse.com> wrote:
> >> - if ( amd_iommu_update_ivrs_mapping_acpi() != 0 )
> >> + rc = amd_iommu_update_ivrs_mapping_acpi();
> >> + if ( rc )
> >> goto error_out;
> >>
> >> /* initialize io-apic interrupt remapping entries */
> >> - if ( iommu_intremap && amd_iommu_setup_ioapic_remapping() != 0 )
> >> + if ( iommu_intremap )
> >> + rc = amd_iommu_setup_ioapic_remapping();
> >> + if ( rc )
> >> goto error_out;
> >
> >
> > Is it better to indent this if() here? Then,
> >
> > + if ( iommu_intremap )
> > + {
> > + rc = amd_iommu_setup_ioapic_remapping();
> > + if ( rc )
> > + goto error_out;
> > + }
>
> What would this help (apart from increasing LOC and patch size)?
>
Ah, first of all, it is not a logic issue, but just make the code clear:
- this if( rc ) is called only if ( iommu_intremap ) is true.
- this error is from amd_iommu_setup_ioapic_remapping().
Also from '- if ( iommu_intremap && amd_iommu_setup_ioapic_remapping() != 0 )', I'd like to fix it as my suggestion.
Quan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
prev parent reply other threads:[~2016-06-16 8:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-14 9:03 [PATCH] AMD IOMMU: correctly propagate errors from amd_iommu_init() Jan Beulich
2016-06-14 9:09 ` Andrew Cooper
2016-06-15 15:25 ` Suravee Suthikulanit
2016-06-16 2:03 ` Xu, Quan
2016-06-16 8:28 ` Jan Beulich
2016-06-16 8:57 ` Xu, Quan [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=945CA011AD5F084CBEA3E851C0AB28894B8E6745@SHSMSX103.ccr.corp.intel.com \
--to=quan.xu@intel.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=xen-devel@lists.xenproject.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).