]> xenbits.xensource.com Git - xen.git/commitdiff
x86/mmcfg: Fix initalisation of variables in pci_mmcfg_nvidia_mcp55()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 3 Aug 2016 09:48:42 +0000 (10:48 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 3 Aug 2016 17:46:59 +0000 (18:46 +0100)
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@citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
xen/arch/x86/x86_64/mmconfig-shared.c

index 742bc1862f06f1ef0f25b340d944775e79a6ca54..a7592c6fe98e242ea7889a7e6daee8c6f47660ff 100644 (file)
@@ -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};