diff options
author | Laszlo Ersek <lersek@redhat.com> | 2019-04-12 13:56:51 +0200 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2019-04-24 17:30:46 +0200 |
commit | d976f09d99b738d3e0de173e3c77fceb0735cc69 (patch) | |
tree | 1dc8e43063f4dd584a5af4904bc50b446093abe0 | |
parent | 1a734ed85fda71630c795832e6d24ea560caf739 (diff) | |
download | edk2-d976f09d99b738d3e0de173e3c77fceb0735cc69.tar.gz edk2-d976f09d99b738d3e0de173e3c77fceb0735cc69.tar.bz2 edk2-d976f09d99b738d3e0de173e3c77fceb0735cc69.zip |
MdePkg/PiFirmwareFile: express IS_SECTION2 in terms of SECTION_SIZE
The IS_SECTION2() function-like macro duplicates the SECTION_SIZE()
calculation, just to compare the computed size against 0xFFFFFF. Invoke
SECTION_SIZE() instead; only preserve the comparison.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1710
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
-rw-r--r-- | MdePkg/Include/Pi/PiFirmwareFile.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/MdePkg/Include/Pi/PiFirmwareFile.h b/MdePkg/Include/Pi/PiFirmwareFile.h index 56efabcba3..a9f3bcc4eb 100644 --- a/MdePkg/Include/Pi/PiFirmwareFile.h +++ b/MdePkg/Include/Pi/PiFirmwareFile.h @@ -480,12 +480,12 @@ typedef struct { CHAR16 VersionString[1];
} EFI_VERSION_SECTION2;
-#define IS_SECTION2(SectionHeaderPtr) \
- ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) (UINTN) SectionHeaderPtr)->Size) & 0x00ffffff) == 0x00ffffff)
-
#define SECTION_SIZE(SectionHeaderPtr) \
((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) (UINTN) SectionHeaderPtr)->Size) & 0x00ffffff))
+#define IS_SECTION2(SectionHeaderPtr) \
+ (SECTION_SIZE (SectionHeaderPtr) == 0x00ffffff)
+
#define SECTION2_SIZE(SectionHeaderPtr) \
(((EFI_COMMON_SECTION_HEADER2 *) (UINTN) SectionHeaderPtr)->ExtendedSize)
|