]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update the PciXXXReadBuffer() for better coding style.
authoryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 29 Dec 2007 06:11:52 +0000 (06:11 +0000)
committeryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 29 Dec 2007 06:11:52 +0000 (06:11 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4449 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BasePciCf8Lib/PciLib.c
MdePkg/Library/BasePciExpressLib/PciLib.c

index d61f80db6e1b28b21493de6d5cbfb0950dbaee28..64bd1557fc5d86ca5c0ea47cdd90993c3175c1e7 100644 (file)
@@ -1302,7 +1302,6 @@ PciCf8ReadBuffer (
   )\r
 {\r
   UINTN   ReturnValue;\r
   )\r
 {\r
   UINTN   ReturnValue;\r
-  UINTN   Value;\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);\r
@@ -1332,8 +1331,7 @@ PciCf8ReadBuffer (
     //\r
     // Read a word if StartAddress is word aligned\r
     //\r
     //\r
     // Read a word if StartAddress is word aligned\r
     //\r
-    Value = (UINTN) PciCf8Read16 (StartAddress);\r
-    WriteUnaligned16 ((UINT16 *)Buffer, (UINT16) Value);\r
+    WriteUnaligned16 ((UINT16 *)Buffer, (UINT16) PciCf8Read16 (StartAddress));\r
 \r
     StartAddress += sizeof (UINT16);\r
     Size -= sizeof (UINT16);\r
 \r
     StartAddress += sizeof (UINT16);\r
     Size -= sizeof (UINT16);\r
@@ -1344,8 +1342,7 @@ PciCf8ReadBuffer (
     //\r
     // Read as many double words as possible\r
     //\r
     //\r
     // Read as many double words as possible\r
     //\r
-    Value = (UINTN) PciCf8Read32 (StartAddress);\r
-    WriteUnaligned32 ((UINT32 *)Buffer, (UINT32) Value);\r
+    WriteUnaligned32 ((UINT32 *)Buffer, (UINT32) PciCf8Read32 (StartAddress));\r
     StartAddress += sizeof (UINT32);\r
     Size -= sizeof (UINT32);\r
     Buffer = (UINT32*)Buffer + 1;\r
     StartAddress += sizeof (UINT32);\r
     Size -= sizeof (UINT32);\r
     Buffer = (UINT32*)Buffer + 1;\r
@@ -1355,8 +1352,7 @@ PciCf8ReadBuffer (
     //\r
     // Read the last remaining word if exist\r
     //\r
     //\r
     // Read the last remaining word if exist\r
     //\r
-    Value = (UINTN) PciCf8Read16 (StartAddress);\r
-    WriteUnaligned16 ((UINT16 *)Buffer, (UINT16) Value);\r
+    WriteUnaligned16 ((UINT16 *)Buffer, (UINT16) PciCf8Read16 (StartAddress));\r
     StartAddress += sizeof (UINT16);\r
     Size -= sizeof (UINT16);\r
     Buffer = (UINT16*)Buffer + 1;\r
     StartAddress += sizeof (UINT16);\r
     Size -= sizeof (UINT16);\r
     Buffer = (UINT16*)Buffer + 1;\r
index d368f674b522b12477247c444433637d921cf3e5..fab8107af38316ec5833a55e1229cde802f18e5b 100644 (file)
@@ -1210,7 +1210,6 @@ PciExpressReadBuffer (
   )\r
 {\r
   UINTN   ReturnValue;\r
   )\r
 {\r
   UINTN   ReturnValue;\r
-  UINTN   Value;\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\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
     //\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
 \r
     StartAddress += sizeof (UINT16);\r
     Size -= sizeof (UINT16);\r
@@ -1252,8 +1250,7 @@ PciExpressReadBuffer (
     //\r
     // Read as many double words as possible\r
     //\r
     //\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
 \r
     StartAddress += sizeof (UINT32);\r
     Size -= sizeof (UINT32);\r
@@ -1264,8 +1261,7 @@ PciExpressReadBuffer (
     //\r
     // Read the last remaining word if exist\r
     //\r
     //\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
     StartAddress += sizeof (UINT16);\r
     Size -= sizeof (UINT16);\r
     Buffer = (UINT16*)Buffer + 1;\r