public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] PcAtChipsetPkg/SerialIoLib: Remove negative value shift
@ 2017-05-18 17:03 Michael Kinney
  2017-05-18 17:24 ` Laszlo Ersek
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Kinney @ 2017-05-18 17:03 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ruiyu Ni, Andrew Fish, Laszlo Ersek, Michael D Kinney

https://bugzilla.tianocore.org/show_bug.cgi?id=553

Remove left shift of negative values that always evaluate
to 0 to address build errors from the llvm/clang compiler
used in the XCODE5 tool chain.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c b/PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c
index 95e0db7..0a2e20c 100644
--- a/PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c
+++ b/PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c
@@ -102,7 +102,7 @@ SerialPortInitialize (
   //
   // Switch back to bank 0
   //
-  OutputData = (UINT8) ((~DLAB << 7) | (gBreakSet << 6) | (gParity << 3) | (gStop << 2) | Data);
+  OutputData = (UINT8) ( (gBreakSet << 6) | (gParity << 3) | (gStop << 2) | Data);
   IoWrite8 (gUartBase + LCR_OFFSET, OutputData);
 
   return RETURN_SUCCESS;
@@ -481,7 +481,7 @@ SerialPortSetAttributes (
   //
   // Switch back to bank 0
   //
-  OutputData = (UINT8) ((~DLAB << 7) | (gBreakSet << 6) | (LcrParity << 3) | (LcrStop << 2) | LcrData);
+  OutputData = (UINT8) ((gBreakSet << 6) | (LcrParity << 3) | (LcrStop << 2) | LcrData);
   IoWrite8 (gUartBase + LCR_OFFSET, OutputData);
 
   return RETURN_SUCCESS;
-- 
2.6.3.windows.1



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

end of thread, other threads:[~2017-05-18 17:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-18 17:03 [Patch] PcAtChipsetPkg/SerialIoLib: Remove negative value shift Michael Kinney
2017-05-18 17:24 ` Laszlo Ersek

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