diff options
author | yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-12-29 06:11:52 +0000 |
---|---|---|
committer | yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-12-29 06:11:52 +0000 |
commit | af2bb549adeefd4e4ae266b8574270218dd5da7c (patch) | |
tree | f1d349487c7fb279cf61f5207b5ac16b37503891 /MdePkg/Library/BasePciExpressLib | |
parent | ab4a8f335779c87b0331d570f093bce0a5dc37d0 (diff) | |
download | edk2-af2bb549adeefd4e4ae266b8574270218dd5da7c.tar.gz edk2-af2bb549adeefd4e4ae266b8574270218dd5da7c.tar.bz2 edk2-af2bb549adeefd4e4ae266b8574270218dd5da7c.zip |
Update the PciXXXReadBuffer() for better coding style.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4449 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BasePciExpressLib')
-rw-r--r-- | MdePkg/Library/BasePciExpressLib/PciLib.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/MdePkg/Library/BasePciExpressLib/PciLib.c b/MdePkg/Library/BasePciExpressLib/PciLib.c index d368f674b5..fab8107af3 100644 --- a/MdePkg/Library/BasePciExpressLib/PciLib.c +++ b/MdePkg/Library/BasePciExpressLib/PciLib.c @@ -1210,7 +1210,6 @@ PciExpressReadBuffer ( )
{
UINTN ReturnValue;
- UINTN Value;
ASSERT_INVALID_PCI_ADDRESS (StartAddress);
ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
@@ -1240,8 +1239,7 @@ PciExpressReadBuffer ( //
// Read a word if StartAddress is word aligned
//
- Value = (UINTN) PciExpressRead16 (StartAddress);
- WriteUnaligned16 ((UINT16 *) Buffer, (UINT16) Value);
+ WriteUnaligned16 ((UINT16 *) Buffer, (UINT16) PciExpressRead16 (StartAddress));
StartAddress += sizeof (UINT16);
Size -= sizeof (UINT16);
@@ -1252,8 +1250,7 @@ PciExpressReadBuffer ( //
// Read as many double words as possible
//
- Value = (UINTN) PciExpressRead32 (StartAddress);
- WriteUnaligned32 ((UINT32 *) Buffer, (UINT32) Value);
+ WriteUnaligned32 ((UINT32 *) Buffer, (UINT32) PciExpressRead32 (StartAddress));
StartAddress += sizeof (UINT32);
Size -= sizeof (UINT32);
@@ -1264,8 +1261,7 @@ PciExpressReadBuffer ( //
// Read the last remaining word if exist
//
- Value = (UINTN) PciExpressRead16 (StartAddress);
- WriteUnaligned16 ((UINT16 *) Buffer, (UINT16) Value);
+ WriteUnaligned16 ((UINT16 *) Buffer, (UINT16) PciExpressRead16 (StartAddress));
StartAddress += sizeof (UINT16);
Size -= sizeof (UINT16);
Buffer = (UINT16*)Buffer + 1;
|