@@ -115,7 +115,7 @@ int hv_call_create_partition(u64 flags,
115115 status = hv_do_hypercall (HVCALL_CREATE_PARTITION ,
116116 input , output );
117117
118- if (hv_result (status ) != HV_STATUS_INSUFFICIENT_MEMORY ) {
118+ if (! hv_result_needs_memory (status )) {
119119 if (hv_result_success (status ))
120120 * partition_id = output -> partition_id ;
121121 local_irq_restore (irq_flags );
@@ -147,7 +147,7 @@ int hv_call_initialize_partition(u64 partition_id)
147147 status = hv_do_fast_hypercall8 (HVCALL_INITIALIZE_PARTITION ,
148148 * (u64 * )& input );
149149
150- if (hv_result (status ) != HV_STATUS_INSUFFICIENT_MEMORY ) {
150+ if (! hv_result_needs_memory (status )) {
151151 ret = hv_result_to_errno (status );
152152 break ;
153153 }
@@ -239,7 +239,7 @@ static int hv_do_map_gpa_hcall(u64 partition_id, u64 gfn, u64 page_struct_count,
239239
240240 completed = hv_repcomp (status );
241241
242- if (hv_result (status ) == HV_STATUS_INSUFFICIENT_MEMORY ) {
242+ if (hv_result_needs_memory (status )) {
243243 ret = hv_call_deposit_pages (NUMA_NO_NODE , partition_id ,
244244 HV_MAP_GPA_DEPOSIT_PAGES );
245245 if (ret )
@@ -455,7 +455,7 @@ int hv_call_get_vp_state(u32 vp_index, u64 partition_id,
455455
456456 status = hv_do_hypercall (control , input , output );
457457
458- if (hv_result (status ) != HV_STATUS_INSUFFICIENT_MEMORY ) {
458+ if (! hv_result_needs_memory (status )) {
459459 if (hv_result_success (status ) && ret_output )
460460 memcpy (ret_output , output , sizeof (* output ));
461461
@@ -518,7 +518,7 @@ int hv_call_set_vp_state(u32 vp_index, u64 partition_id,
518518
519519 status = hv_do_hypercall (control , input , NULL );
520520
521- if (hv_result (status ) != HV_STATUS_INSUFFICIENT_MEMORY ) {
521+ if (! hv_result_needs_memory (status )) {
522522 local_irq_restore (flags );
523523 ret = hv_result_to_errno (status );
524524 break ;
@@ -563,7 +563,7 @@ static int hv_call_map_vp_state_page(u64 partition_id, u32 vp_index, u32 type,
563563 status = hv_do_hypercall (HVCALL_MAP_VP_STATE_PAGE , input ,
564564 output );
565565
566- if (hv_result (status ) != HV_STATUS_INSUFFICIENT_MEMORY ) {
566+ if (! hv_result_needs_memory (status )) {
567567 if (hv_result_success (status ))
568568 * state_page = pfn_to_page (output -> map_location );
569569 local_irq_restore (flags );
@@ -718,7 +718,7 @@ hv_call_create_port(u64 port_partition_id, union hv_port_id port_id,
718718 if (hv_result_success (status ))
719719 break ;
720720
721- if (hv_result (status ) != HV_STATUS_INSUFFICIENT_MEMORY ) {
721+ if (! hv_result_needs_memory (status )) {
722722 ret = hv_result_to_errno (status );
723723 break ;
724724 }
@@ -772,7 +772,7 @@ hv_call_connect_port(u64 port_partition_id, union hv_port_id port_id,
772772 if (hv_result_success (status ))
773773 break ;
774774
775- if (hv_result (status ) != HV_STATUS_INSUFFICIENT_MEMORY ) {
775+ if (! hv_result_needs_memory (status )) {
776776 ret = hv_result_to_errno (status );
777777 break ;
778778 }
@@ -850,7 +850,7 @@ static int hv_call_map_stats_page2(enum hv_stats_object_type type,
850850 if (!ret )
851851 break ;
852852
853- if (hv_result (status ) != HV_STATUS_INSUFFICIENT_MEMORY ) {
853+ if (! hv_result_needs_memory (status )) {
854854 hv_status_debug (status , "\n" );
855855 break ;
856856 }
@@ -899,7 +899,7 @@ hv_call_map_stats_page(enum hv_stats_object_type type,
899899 struct hv_input_map_stats_page * input ;
900900 struct hv_output_map_stats_page * output ;
901901 u64 status , pfn ;
902- int hv_status , ret = 0 ;
902+ int ret = 0 ;
903903
904904 do {
905905 local_irq_save (flags );
@@ -915,13 +915,12 @@ hv_call_map_stats_page(enum hv_stats_object_type type,
915915
916916 local_irq_restore (flags );
917917
918- hv_status = hv_result (status );
919- if (hv_status != HV_STATUS_INSUFFICIENT_MEMORY ) {
918+ if (!hv_result_needs_memory (status )) {
920919 if (hv_result_success (status ))
921920 break ;
922921
923922 if (hv_stats_get_area_type (type , identity ) == HV_STATS_AREA_PARENT &&
924- hv_status == HV_STATUS_INVALID_PARAMETER ) {
923+ hv_result ( status ) == HV_STATUS_INVALID_PARAMETER ) {
925924 * addr = NULL ;
926925 return 0 ;
927926 }
0 commit comments