public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms] [PATCH] KabyLakeSiliconPkg: Bitmask comparison logic bug
@ 2020-06-10  0:30 Nate DeSimone
  2020-06-11  2:01 ` Chaganty, Rangasai V
  2020-06-11 23:50 ` Chiu, Chasel
  0 siblings, 2 replies; 3+ messages in thread
From: Nate DeSimone @ 2020-06-10  0:30 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Sai Chaganty

(Cpptv & B_PCH_SPI_SFDPX_VSCCX_CPPTV) can only evaluate to
two possible values, 0x0 or B_PCH_SPI_SFDPX_VSCCX_CPPTV
(aka BIT31). The current comparison to 0x1 will always fail.

Fixed the if statement to compare to B_PCH_SPI_SFDPX_VSCCX_CPPTV.

Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
---
 .../KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c b/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c
index a255e7e514..467e133cd5 100644
--- a/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c
+++ b/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/BootFirmwareMediaProtection.c
@@ -167,7 +167,7 @@ CheckBootFirmwareMediaProtection (
       FreePool (HstiErrorString);
     }
   } else {
-    if ((Cpptv & B_PCH_SPI_SFDPX_VSCCX_CPPTV) == 1) {
+    if ((Cpptv & B_PCH_SPI_SFDPX_VSCCX_CPPTV) == B_PCH_SPI_SFDPX_VSCCX_CPPTV) {
 
       HstiErrorString = BuildHstiErrorString (HSTI_BYTE0_BOOT_FIRMWARE_MEDIA_PROTECTION_ERROR_CODE_6 ,HSTI_SPI_FLASH_CONFIGURATION, HSTI_BYTE0_BOOT_FIRMWARE_MEDIA_PROTECTION_ERROR_STRING_6);
       Status = HstiLibAppendErrorString (
-- 
2.20.1


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

end of thread, other threads:[~2020-06-11 23:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-10  0:30 [edk2-platforms] [PATCH] KabyLakeSiliconPkg: Bitmask comparison logic bug Nate DeSimone
2020-06-11  2:01 ` Chaganty, Rangasai V
2020-06-11 23:50 ` Chiu, Chasel

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