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-changelog

[Xen-changelog] [linux-2.6.18-xen] xen/firmware: Simplify Xen-interfacin

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] xen/firmware: Simplify Xen-interfacing code. The firmware-info maps
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Jun 2007 05:05:09 -0700
Delivery-date: Thu, 21 Jun 2007 05:03:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1182415500 -3600
# Node ID 6d30a91a72c66127c6445b40c0510b2d6ee72e42
# Parent  db1ad4e3caf50efd45726d4b6e483869e20a8e51
xen/firmware: Simplify Xen-interfacing code. The firmware-info maps
will be guaranteed to be densely populated from index 0 to max-1,
hence when we see an error it is always appropriate to bail from the
loop.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 drivers/xen/core/firmware.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff -r db1ad4e3caf5 -r 6d30a91a72c6 drivers/xen/core/firmware.c
--- a/drivers/xen/core/firmware.c       Wed Jun 20 19:28:54 2007 +0100
+++ b/drivers/xen/core/firmware.c       Thu Jun 21 09:45:00 2007 +0100
@@ -10,25 +10,25 @@ void __init copy_edd(void)
 void __init copy_edd(void)
 {
        int ret;
-       xen_platform_op_t op;
+       struct xen_platform_op op;
 
        if (!is_initial_xendomain())
                return;
 
        op.cmd = XENPF_firmware_info;
 
-       for (op.u.firmware_info.index = 0, ret = 0;
-            ret != -ESRCH && ret != -ENOSYS && edd.edd_info_nr < EDDMAXNR;
-            ++op.u.firmware_info.index) {
+       op.u.firmware_info.type = XEN_FW_DISK_INFO;
+       for (op.u.firmware_info.index = 0;
+            edd.edd_info_nr < EDDMAXNR;
+            op.u.firmware_info.index++) {
                struct edd_info *info = edd.edd_info + edd.edd_info_nr;
 
-               op.u.firmware_info.type = XEN_FW_DISK_INFO;
                info->params.length = sizeof(info->params);
                set_xen_guest_handle(op.u.firmware_info.u.disk_info.edd_params,
                                     &info->params);
                ret = HYPERVISOR_platform_op(&op);
                if (ret)
-                       continue;
+                       break;
 
 #define C(x) info->x = op.u.firmware_info.u.disk_info.x
                C(device);
@@ -39,17 +39,16 @@ void __init copy_edd(void)
                C(legacy_sectors_per_track);
 #undef C
 
-               ++edd.edd_info_nr;
+               edd.edd_info_nr++;
        }
 
        op.u.firmware_info.type = XEN_FW_DISK_MBR_SIGNATURE;
-       for (op.u.firmware_info.index = 0, ret = 0;
-            (ret != -ESRCH && ret != -ENOSYS &&
-             edd.mbr_signature_nr < EDD_MBR_SIG_MAX);
-            ++op.u.firmware_info.index) {
+       for (op.u.firmware_info.index = 0;
+            edd.mbr_signature_nr < EDD_MBR_SIG_MAX;
+            op.u.firmware_info.index++) {
                ret = HYPERVISOR_platform_op(&op);
                if (ret)
-                       continue;
+                       break;
                edd.mbr_signature[edd.mbr_signature_nr++] =
                        op.u.firmware_info.u.disk_mbr_signature.mbr_signature;
        }
@@ -59,7 +58,7 @@ void __init copy_edid(void)
 void __init copy_edid(void)
 {
 #if defined(CONFIG_FIRMWARE_EDID) && defined(CONFIG_X86)
-       xen_platform_op_t op;
+       struct xen_platform_op op;
 
        if (!is_initial_xendomain())
                return;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] xen/firmware: Simplify Xen-interfacing code. The firmware-info maps, Xen patchbot-linux-2.6.18-xen <=