]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Fix a bug in smbiosview PowerSupply Characteristics.
authorSamer El-Haj-Mahmoud <elhaj@hpe.com>
Wed, 16 Dec 2015 02:14:05 +0000 (02:14 +0000)
committershenshushi <shenshushi@Edk2>
Wed, 16 Dec 2015 02:14:05 +0000 (02:14 +0000)
Fix bit shifting when isolating the Characteristics of Power Supply information.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19291 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c

index e348c6f25c3afd96a13b21fb331d466d0d0324ed..3f99dc4825dc027070b6250e30930d1686c598f6 100644 (file)
@@ -3100,7 +3100,7 @@ DisplaySPSCharacteristics (
   // Bits 13:10 - DMTF Power Supply Type\r
   //\r
   ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TYPE), gShellDebug1HiiHandle);\r
-  Temp = (Characteristics & 0x1C00) << 10;\r
+  Temp = (Characteristics & 0x1C00) >> 10;\r
   switch (Temp) {\r
   case 1:\r
     ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);\r
@@ -3141,7 +3141,7 @@ DisplaySPSCharacteristics (
   // Bits 9:7 - Status\r
   //\r
   ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STATUS_DASH), gShellDebug1HiiHandle);\r
-  Temp = (Characteristics & 0x380) << 7;\r
+  Temp = (Characteristics & 0x380) >> 7;\r
   switch (Temp) {\r
   case 1:\r
     ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);\r
@@ -3170,7 +3170,7 @@ DisplaySPSCharacteristics (
   // Bits 6:3 - DMTF Input Voltage Range Switching\r
   //\r
   ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INPUT_VOLTAGE_RANGE), gShellDebug1HiiHandle);\r
-  Temp = (Characteristics & 0x78) << 3;\r
+  Temp = (Characteristics & 0x78) >> 3;\r
   switch (Temp) {\r
   case 1:\r
     ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);\r