WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 3 of 7] IOMMU: Sanitise pointer work

To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 3 of 7] IOMMU: Sanitise pointer work
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Mon, 13 Jun 2011 19:13:27 +0100
Cc:
Delivery-date: Mon, 13 Jun 2011 11:14:27 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:user-agent:date:subject:from:to:message-id :thread-topic:thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=MsaB747S3ljSHz58xnTxyilBoA/SBlglQHglAl5SJgs=; b=s46L+guuzswB+UcKqe1arHaMpNHUuFkYYQ4xjB6Of/TUXhtp0GJO6zoX7eqkczGfmU nQSFF34po5cSQJxJO9UCBI52evOY20yUkwElly9axrNHGJNiCKJ8IUvztqSCGj5Fwgeb 5k/n0CYP5dVYTqqvWRPR+WVlvA88Q5MsEzUak=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=FgyvlMW6rzXnGyWD5YFvZAfaEr3pNSItjDHVk9vny+Ec7DEsxmA9Og5IU1XYJTAsbZ iy9Juk/ASsKxCbQnU+tiO1b5kZ9iPCpv5OD4amTSCkNSsCPVOlbEwR6G1uv1u/PIiWjS pMWMzkRHs6afIOTTEx0d/3IEp/MLqXtEKZ1Xc=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <68efd418b6f149034aed.1307984570@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acwp9ZdbcyMqx/6nhEKIb+qVRxc5dg==
Thread-topic: [Xen-devel] [PATCH 3 of 7] IOMMU: Sanitise pointer work
User-agent: Microsoft-Entourage/12.29.0.110113
On 13/06/2011 18:02, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx> wrote:

> Check for null pointers before calling function pointers.

But they're never NULL? This one's a bit pointless.

 -- Keir

> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> 
> diff -r 1c3d2e4d06fe -r 68efd418b6f1 xen/drivers/passthrough/iommu.c
> --- a/xen/drivers/passthrough/iommu.c Mon Jun 13 17:45:43 2011 +0100
> +++ b/xen/drivers/passthrough/iommu.c Mon Jun 13 17:45:43 2011 +0100
> @@ -407,17 +407,17 @@ unsigned int iommu_read_apic_from_ire(un
>      return ops->read_apic_from_ire(apic, reg);
>  }
>  
> -void iommu_resume()
> +void iommu_resume(void)
>  {
>      const struct iommu_ops *ops = iommu_get_ops();
> -    if ( iommu_enabled )
> +    if ( iommu_enabled && ops && ops->resume )
>          ops->resume();
>  }
>  
> -void iommu_suspend()
> +void iommu_suspend(void)
>  {
>      const struct iommu_ops *ops = iommu_get_ops();
> -    if ( iommu_enabled )
> +    if ( iommu_enabled && ops && ops->suspend )
>          ops->suspend();
>  }
>  
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>