]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BasePciExpressLib/PciLib.c
Update the PciXXXReadBuffer() for better coding style.
[mirror_edk2.git] / MdePkg / Library / BasePciExpressLib / PciLib.c
index d368f674b522b12477247c444433637d921cf3e5..fab8107af38316ec5833a55e1229cde802f18e5b 100644 (file)
@@ -1210,7 +1210,6 @@ PciExpressReadBuffer (
   )\r
 {\r
   UINTN   ReturnValue;\r
-  UINTN   Value;\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
@@ -1240,8 +1239,7 @@ PciExpressReadBuffer (
     //\r
     // Read a word if StartAddress is word aligned\r
     //\r
-    Value = (UINTN) PciExpressRead16 (StartAddress);\r
-    WriteUnaligned16 ((UINT16 *) Buffer, (UINT16) Value);\r
+    WriteUnaligned16 ((UINT16 *) Buffer, (UINT16) PciExpressRead16 (StartAddress));\r
 \r
     StartAddress += sizeof (UINT16);\r
     Size -= sizeof (UINT16);\r
@@ -1252,8 +1250,7 @@ PciExpressReadBuffer (
     //\r
     // Read as many double words as possible\r
     //\r
-    Value = (UINTN) PciExpressRead32 (StartAddress);\r
-    WriteUnaligned32 ((UINT32 *) Buffer, (UINT32) Value);\r
+    WriteUnaligned32 ((UINT32 *) Buffer, (UINT32) PciExpressRead32 (StartAddress));\r
 \r
     StartAddress += sizeof (UINT32);\r
     Size -= sizeof (UINT32);\r
@@ -1264,8 +1261,7 @@ PciExpressReadBuffer (
     //\r
     // Read the last remaining word if exist\r
     //\r
-    Value = (UINTN) PciExpressRead16 (StartAddress);\r
-    WriteUnaligned16 ((UINT16 *) Buffer, (UINT16) Value);\r
+    WriteUnaligned16 ((UINT16 *) Buffer, (UINT16) PciExpressRead16 (StartAddress));\r
     StartAddress += sizeof (UINT16);\r
     Size -= sizeof (UINT16);\r
     Buffer = (UINT16*)Buffer + 1;\r