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

[Xen-devel] [PATCH 04 of 12] xenpaging: remove return values from functions that can not fail


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Olaf Hering <olaf@xxxxxxxxx>
  • Date: Tue, 07 Jun 2011 11:53:06 +0200
  • Delivery-date: Tue, 07 Jun 2011 02:56:32 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1307437212 -7200
# Node ID c31636354b69164c06e86feed58f9713656b8f0c
# Parent  e2480aad3a3bd4e801bd79daf1b6ee77efe1ed7c
xenpaging: remove return values from functions that can not fail

get_request() and put_response() can not fail, remove return value
and update calling functions.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

diff -r e2480aad3a3b -r c31636354b69 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c       Tue Jun 07 11:00:11 2011 +0200
+++ b/tools/xenpaging/xenpaging.c       Tue Jun 07 11:00:12 2011 +0200
@@ -297,7 +297,7 @@ static int xenpaging_teardown(xenpaging_
     return -1;
 }
 
-static int get_request(mem_event_t *mem_event, mem_event_request_t *req)
+static void get_request(mem_event_t *mem_event, mem_event_request_t *req)
 {
     mem_event_back_ring_t *back_ring;
     RING_IDX req_cons;
@@ -316,11 +316,9 @@ static int get_request(mem_event_t *mem_
     back_ring->sring->req_event = req_cons + 1;
 
     mem_event_ring_unlock(mem_event);
-
-    return 0;
 }
 
-static int put_response(mem_event_t *mem_event, mem_event_response_t *rsp)
+static void put_response(mem_event_t *mem_event, mem_event_response_t *rsp)
 {
     mem_event_back_ring_t *back_ring;
     RING_IDX rsp_prod;
@@ -339,8 +337,6 @@ static int put_response(mem_event_t *mem
     RING_PUSH_RESPONSES(back_ring);
 
     mem_event_ring_unlock(mem_event);
-
-    return 0;
 }
 
 static int xenpaging_evict_page(xenpaging_t *paging,
@@ -400,9 +396,7 @@ static int xenpaging_resume_page(xenpagi
     int ret;
 
     /* Put the page info on the ring */
-    ret = put_response(&paging->mem_event, rsp);
-    if ( ret != 0 )
-        goto out;
+    put_response(&paging->mem_event, rsp);
 
     /* Notify policy of page being paged in */
     if ( notify_policy )
@@ -612,12 +606,7 @@ int main(int argc, char *argv[])
 
         while ( RING_HAS_UNCONSUMED_REQUESTS(&paging->mem_event.back_ring) )
         {
-            rc = get_request(&paging->mem_event, &req);
-            if ( rc != 0 )
-            {
-                ERROR("Error getting request");
-                goto out;
-            }
+            get_request(&paging->mem_event, &req);
 
             /* Check if the page has already been paged in */
             if ( test_and_clear_bit(req.gfn, paging->bitmap) )

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


 


Rackspace

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