[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] gnttab: clean up main switch in do_grant_table_op()
commit d3c47a1839c0b21e6b9fffc8fa0f27ce4bbde751 Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Thu Aug 17 14:44:38 2017 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Thu Aug 17 14:44:38 2017 +0200 gnttab: clean up main switch in do_grant_table_op() Add blank lines as necessary and drop unnecessary braces. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- xen/common/grant_table.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index fdd8e4e..36895aa 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -3144,6 +3144,7 @@ do_grant_table_op( { XEN_GUEST_HANDLE_PARAM(gnttab_map_grant_ref_t) map = guest_handle_cast(uop, gnttab_map_grant_ref_t); + if ( unlikely(!guest_handle_okay(map, count)) ) goto out; rc = gnttab_map_grant_ref(map, count); @@ -3154,10 +3155,12 @@ do_grant_table_op( } break; } + case GNTTABOP_unmap_grant_ref: { XEN_GUEST_HANDLE_PARAM(gnttab_unmap_grant_ref_t) unmap = guest_handle_cast(uop, gnttab_unmap_grant_ref_t); + if ( unlikely(!guest_handle_okay(unmap, count)) ) goto out; rc = gnttab_unmap_grant_ref(unmap, count); @@ -3168,10 +3171,12 @@ do_grant_table_op( } break; } + case GNTTABOP_unmap_and_replace: { XEN_GUEST_HANDLE_PARAM(gnttab_unmap_and_replace_t) unmap = guest_handle_cast(uop, gnttab_unmap_and_replace_t); + if ( unlikely(!guest_handle_okay(unmap, count)) ) goto out; rc = -ENOSYS; @@ -3185,17 +3190,18 @@ do_grant_table_op( } break; } + case GNTTABOP_setup_table: - { rc = gnttab_setup_table( guest_handle_cast(uop, gnttab_setup_table_t), count); ASSERT(rc <= 0); break; - } + case GNTTABOP_transfer: { XEN_GUEST_HANDLE_PARAM(gnttab_transfer_t) transfer = guest_handle_cast(uop, gnttab_transfer_t); + if ( unlikely(!guest_handle_okay(transfer, count)) ) goto out; rc = gnttab_transfer(transfer, count); @@ -3206,10 +3212,12 @@ do_grant_table_op( } break; } + case GNTTABOP_copy: { XEN_GUEST_HANDLE_PARAM(gnttab_copy_t) copy = guest_handle_cast(uop, gnttab_copy_t); + if ( unlikely(!guest_handle_okay(copy, count)) ) goto out; rc = gnttab_copy(copy, count); @@ -3221,33 +3229,31 @@ do_grant_table_op( } break; } + case GNTTABOP_query_size: - { rc = gnttab_query_size( guest_handle_cast(uop, gnttab_query_size_t), count); ASSERT(rc <= 0); break; - } + case GNTTABOP_set_version: - { rc = gnttab_set_version(guest_handle_cast(uop, gnttab_set_version_t)); break; - } + case GNTTABOP_get_status_frames: - { rc = gnttab_get_status_frames( guest_handle_cast(uop, gnttab_get_status_frames_t), count); break; - } + case GNTTABOP_get_version: - { rc = gnttab_get_version(guest_handle_cast(uop, gnttab_get_version_t)); break; - } + case GNTTABOP_swap_grant_ref: { XEN_GUEST_HANDLE_PARAM(gnttab_swap_grant_ref_t) swap = guest_handle_cast(uop, gnttab_swap_grant_ref_t); + if ( unlikely(!guest_handle_okay(swap, count)) ) goto out; rc = gnttab_swap_grant_ref(swap, count); @@ -3258,6 +3264,7 @@ do_grant_table_op( } break; } + case GNTTABOP_cache_flush: { XEN_GUEST_HANDLE_PARAM(gnttab_cache_flush_t) cflush = @@ -3274,6 +3281,7 @@ do_grant_table_op( opaque_out = opaque_in; break; } + default: rc = -ENOSYS; break; -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |