]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
x86/grant: mute gcc 4.1.x warning in steal_linear_address()
authorZhenzhong Duan <zhenzhong.duan@oracle.com>
Thu, 30 Aug 2018 09:05:01 +0000 (11:05 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 30 Aug 2018 09:05:01 +0000 (11:05 +0200)
Move reference of ol1e ahead or else we see below warning.

cc1: warnings being treated as errors
grant_table.c: In function 'replace_grant_pv_mapping':
grant_table.c:142: warning: 'ol1e.l1' may be used uninitialized in this function

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/pv/grant_table.c

index 6b7d855c8ac6653b22d1474cbdbdfd03cefc957c..5180334f425d41a9d76d944384280b9bb29f74f6 100644 (file)
@@ -167,6 +167,9 @@ static bool steal_linear_address(unsigned long linear, l1_pgentry_t *out)
     ol1e = *pl1e;
     okay = UPDATE_ENTRY(l1, pl1e, ol1e, l1e_empty(), mfn_x(gl1mfn), curr, 0);
 
+    if ( okay )
+        *out = ol1e;
+
  out_unlock:
     page_unlock(page);
  out_put:
@@ -174,9 +177,6 @@ static bool steal_linear_address(unsigned long linear, l1_pgentry_t *out)
  out_unmap:
     unmap_domain_page(pl1e);
 
-    if ( okay )
-        *out = ol1e;
-
  out:
     return okay;
 }