From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH 1/4] AMD IOMMU: don't BUG() when we don't have to Date: Fri, 15 Feb 2013 12:34:42 -0500 Message-ID: <511E71B2.7010007@oracle.com> References: <511E6CAD02000078000BED19@nat28.tlf.novell.com> <511E6E3502000078000BED4A@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <511E6E3502000078000BED4A@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Sherry Hurwitz , xen-devel List-Id: xen-devel@lists.xenproject.org On 02/15/2013 11:19 AM, Jan Beulich wrote: > find_iommu_for_device() can easily return NULL instead, as all of its > callers are prepared for that. This patch is obsoleted by the second patch ("[PATCH 2/4] AMD IOMMU: cover all functions of a device even if ACPI only tells us of func 0"), isn't it? -boris > > Signed-off-by: Jan Beulich > > --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c > +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c > @@ -32,8 +32,8 @@ struct amd_iommu *find_iommu_for_device( > { > struct ivrs_mappings *ivrs_mappings = get_ivrs_mappings(seg); > > - BUG_ON ( bdf >= ivrs_bdf_entries ); > - return ivrs_mappings ? ivrs_mappings[bdf].iommu : NULL; > + return ivrs_mappings && bdf < ivrs_bdf_entries ? ivrs_mappings[bdf].iommu > + : NULL; > } > > /* > > >