]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c
IntelFrameworkModulePkg IsaSerialDxe: Update algorithm to calculate Divisor
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Isa / IsaSerialDxe / Serial.c
index 57ee669d140682e922f5b0d632eef765e4e411a7..7824d38a9ca8a1ddee3ead85c099296949ba3bdb 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Serial driver for standard UARTS on an ISA bus.\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1397,7 +1397,7 @@ IsaSerialSetAttributes (
                        ((UINT32) BaudRate * 16),\r
                        &Remained\r
                        );\r
-  if (Remained != 0) {\r
+  if (Remained >= ((UINT32) BaudRate * 8)) {\r
     Divisor += 1;\r
   }\r
 \r