public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/2] MdeModulePkg/PciBusDxe: Prevent truncating constant values.
@ 2018-02-27 16:49 Marvin Häuser
  2018-02-27 18:42 ` Laszlo Ersek
  0 siblings, 1 reply; 6+ messages in thread
From: Marvin Häuser @ 2018-02-27 16:49 UTC (permalink / raw)
  To: edk2-devel@lists.01.org
  Cc: star.zeng@intel.com, eric.dong@intel.com, ruiyu.ni@intel.com

The toolcahin VS2015x86 issues warnings when truncating constant
values. Explicitely cast such to avoid it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c
index 2f713fcee95e..a752853f3e9e 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c
@@ -1936,7 +1936,7 @@ ProgramP2C (
                    &BridgeControl
                    );
 
-      BridgeControl &= (UINT16) ~PCI_CARD_PREFETCHABLE_MEMORY_0_ENABLE;
+      BridgeControl &= (UINT16) ~(UINT16)PCI_CARD_PREFETCHABLE_MEMORY_0_ENABLE;
       PciIo->Pci.Write (
                    PciIo,
                    EfiPciIoWidthUint16,
@@ -2005,7 +2005,7 @@ ProgramP2C (
                    &BridgeControl
                    );
 
-      BridgeControl &= (UINT16) ~(PCI_CARD_PREFETCHABLE_MEMORY_1_ENABLE);
+      BridgeControl &= (UINT16) ~(UINT16)(PCI_CARD_PREFETCHABLE_MEMORY_1_ENABLE);
       PciIo->Pci.Write (
                    PciIo,
                    EfiPciIoWidthUint16,
-- 
2.16.0.windows.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-02-28 11:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-27 16:49 [PATCH 1/2] MdeModulePkg/PciBusDxe: Prevent truncating constant values Marvin Häuser
2018-02-27 18:42 ` Laszlo Ersek
2018-02-27 18:50   ` Andrew Fish
2018-02-27 18:57     ` Marvin Häuser
2018-02-28 11:42     ` Laszlo Ersek
2018-02-28 11:48       ` Marvin Häuser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox