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

[Xen-devel] [PATCH 4 of 7] xenpaging: remove return values from function

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 4 of 7] xenpaging: remove return values from functions that can not fail
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Thu, 31 Mar 2011 19:36:21 +0200
Delivery-date: Thu, 31 Mar 2011 10:42:28 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1301592981; l=2002; s=domk; d=aepfle.de; h=To:From:Date:References:In-Reply-To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:X-RZG-CLASS-ID: X-RZG-AUTH; bh=DIakCiKSrpjfhfpvgTY6bc6NPFk=; b=BCvAhGGB6kbbWE8WYYTf7nogDeHVFvy0my/2m9/LzfyPDWZ5zp/xGbh19YhquMLDo1V FWuYQNydDVMWLKLrnpUGeTczVwA6eibHTDRpk/xoB1pEy8zY/Vgw6freWwrp05HLscyd6 yDZlo9VvkCVF7Qlojws8v6EJ4nfuKuuXxV8=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1301592977@localhost>
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>
References: <patchbomb.1301592977@localhost>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.8
# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1301591599 -7200
# Node ID 8825c216096a80e5590ce075da273eeb06c1e7aa
# Parent  cd35892de8ff2388aa46e3768393f217a3c63521
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 cd35892de8ff -r 8825c216096a tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c       Thu Mar 31 19:12:50 2011 +0200
+++ b/tools/xenpaging/xenpaging.c       Thu Mar 31 19:13:19 2011 +0200
@@ -297,7 +297,7 @@
     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 @@
     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 @@
     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 @@
     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 @@
 
         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