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

[Xen-changelog] [xen stable-4.5] x86/mmcfg: Fix initalisation of variables in pci_mmcfg_nvidia_mcp55()



commit c18c1456c48f23d9b31e7a32a21aa1ae9c53df93
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Fri Aug 5 14:08:33 2016 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Aug 5 14:08:33 2016 +0200

    x86/mmcfg: Fix initalisation of variables in pci_mmcfg_nvidia_mcp55()
    
    Shifting into the sign bit of an integer is undefined behaviour.
    
    Only the first integer is actually undefined, but switch all the shifts
    for consistency.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Jan Beulich <JBeulich@xxxxxxxx>
    master commit: ab8fc3937eeb9332b83d7e14d81e37f0b0ef1841
    master date: 2016-08-03 18:46:59 +0100
---
 xen/arch/x86/x86_64/mmconfig-shared.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_64/mmconfig-shared.c 
b/xen/arch/x86/x86_64/mmconfig-shared.c
index 742bc18..a7592c6 100644
--- a/xen/arch/x86/x86_64/mmconfig-shared.c
+++ b/xen/arch/x86/x86_64/mmconfig-shared.c
@@ -182,10 +182,10 @@ static const char __init *pci_mmcfg_nvidia_mcp55(void)
     int bus, i;
 
     static const u32 extcfg_regnum      = 0x90;
-    static const u32 extcfg_enable_mask = 1<<31;
-    static const u32 extcfg_start_mask  = 0xff<<16;
+    static const u32 extcfg_enable_mask = 1u << 31;
+    static const u32 extcfg_start_mask  = 0xffu << 16;
     static const int extcfg_start_shift = 16;
-    static const u32 extcfg_size_mask   = 0x3<<28;
+    static const u32 extcfg_size_mask   = 3u << 28;
     static const int extcfg_size_shift  = 28;
     static const int extcfg_sizebus[]   = {0xff, 0x7f, 0x3f, 0x1f};
     static const u32 extcfg_base_mask[] = {0x7ff8, 0x7ffc, 0x7ffe, 0x7fff};
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.