summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/PeiMemoryLib/MemLibGeneric.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/PeiMemoryLib/MemLibGeneric.c')
-rw-r--r--MdePkg/Library/PeiMemoryLib/MemLibGeneric.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/MdePkg/Library/PeiMemoryLib/MemLibGeneric.c b/MdePkg/Library/PeiMemoryLib/MemLibGeneric.c
index 490b244097..ed18b57582 100644
--- a/MdePkg/Library/PeiMemoryLib/MemLibGeneric.c
+++ b/MdePkg/Library/PeiMemoryLib/MemLibGeneric.c
@@ -37,9 +37,9 @@ InternalMemSetMem16 (
IN UINT16 Value
)
{
- do {
- ((UINT16*)Buffer)[--Length] = Value;
- } while (Length != 0);
+ for (; Length != 0; Length--) {
+ ((UINT16*)Buffer)[Length - 1] = Value;
+ }
return Buffer;
}
@@ -61,9 +61,9 @@ InternalMemSetMem32 (
IN UINT32 Value
)
{
- do {
- ((UINT32*)Buffer)[--Length] = Value;
- } while (Length != 0);
+ for (; Length != 0; Length--) {
+ ((UINT32*)Buffer)[Length - 1] = Value;
+ }
return Buffer;
}
@@ -85,9 +85,9 @@ InternalMemSetMem64 (
IN UINT64 Value
)
{
- do {
- ((UINT64*)Buffer)[--Length] = Value;
- } while (Length != 0);
+ for (; Length != 0; Length--) {
+ ((UINT64*)Buffer)[Length - 1] = Value;
+ }
return Buffer;
}