[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] x86/grant: mute gcc 4.1.x warning in steal_linear_address()



commit 0670eac350717f92d165eb9f57a39bba3b4b7f35
Author:     Zhenzhong Duan <zhenzhong.duan@xxxxxxxxxx>
AuthorDate: Thu Aug 30 11:05:01 2018 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Aug 30 11:05:01 2018 +0200

    x86/grant: mute gcc 4.1.x warning in steal_linear_address()
    
    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@xxxxxxxxxx>
    Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/pv/grant_table.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/pv/grant_table.c b/xen/arch/x86/pv/grant_table.c
index 6b7d855c8a..5180334f42 100644
--- a/xen/arch/x86/pv/grant_table.c
+++ b/xen/arch/x86/pv/grant_table.c
@@ -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;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.