[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [linux-2.6.18-xen] xen/firmware: Simplify Xen-interfacing code. The firmware-info maps
# 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |