From: Zhenzhong Duan Date: Thu, 30 Aug 2018 09:05:01 +0000 (+0200) Subject: x86/grant: mute gcc 4.1.x warning in steal_linear_address() X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~3360 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0670eac350717f92d165eb9f57a39bba3b4b7f35;p=xen.git 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 Reviewed-by: Wei Liu Acked-by: Jan Beulich --- 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; }