[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 5/6] common/gnttab: gnttab_query_size() cleanup



Drop pointless debugging messages, and reduce variable scope.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Tim Deegan <tim@xxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xen/common/grant_table.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 6ed86f5..615a8b4 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1731,31 +1731,25 @@ gnttab_query_size(
     XEN_GUEST_HANDLE_PARAM(gnttab_query_size_t) uop, unsigned int count)
 {
     struct gnttab_query_size op;
-    struct domain *d;
-    int rc;
+    struct domain *d = NULL;
 
     if ( count != 1 )
         return -EINVAL;
 
-    if ( unlikely(copy_from_guest(&op, uop, 1) != 0) )
-    {
-        gdprintk(XENLOG_INFO, "Fault while reading gnttab_query_size_t.\n");
+    if ( unlikely(copy_from_guest(&op, uop, 1)) )
         return -EFAULT;
-    }
 
     d = rcu_lock_domain_by_any_id(op.dom);
     if ( d == NULL )
     {
-        gdprintk(XENLOG_INFO, "Bad domid %d.\n", op.dom);
         op.status = GNTST_bad_domain;
-        goto query_out;
+        goto out;
     }
 
-    rc = xsm_grant_query_size(XSM_TARGET, current->domain, d);
-    if ( rc )
+    if ( xsm_grant_query_size(XSM_TARGET, current->domain, d) )
     {
         op.status = GNTST_permission_denied;
-        goto query_out_unlock;
+        goto out;
     }
 
     grant_read_lock(d->grant_table);
@@ -1766,11 +1760,10 @@ gnttab_query_size(
 
     grant_read_unlock(d->grant_table);
 
+ out:
+    if ( d )
+        rcu_unlock_domain(d);
 
- query_out_unlock:
-    rcu_unlock_domain(d);
-
- query_out:
     if ( unlikely(__copy_to_guest(uop, &op, 1)) )
         return -EFAULT;
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.