Re: [PATCH v2 08/16] DynamicTablesPkg: Fix ACPI table rev field width


Ard Biesheuvel
 

On Sun, 29 Mar 2020 at 17:14, Sami Mujawar <sami.mujawar@arm.com> wrote:

The VS2017 compiler reports 'warning C4244: '=': conversion from
'const UINT32' to 'UINT8', possible loss of data' when the ACPI
table revision field is being updated.

The width of the revision field in the EFI_ACPI_DESCRIPTION_HEADER
struct is 8-bit wide. Therefore, to fix the above warning make the
ACPI Table revision field usage 8-bit wide across Dynamic Tables
Framework.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---

Notes:
v2:
Splitting patch series and re-submitting DynamicTablesPkg [SAMI]
patches from https://edk2.groups.io/g/devel/message/46261

DynamicTablesPkg/Include/AcpiTableGenerator.h | 4 ++--
DynamicTablesPkg/Include/StandardNameSpaceObjects.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h b/DynamicTablesPkg/Include/AcpiTableGenerator.h
index e46717e6e8442ec516ef79ea979bd29e070f6d0a..b55feb4e7507f0e4e1e0a64c3c4b8068f17dad47 100644
--- a/DynamicTablesPkg/Include/AcpiTableGenerator.h
+++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h
@@ -287,10 +287,10 @@ typedef struct AcpiTableGenerator {
UINT32 AcpiTableSignature;

/// The ACPI table revision.
- UINT32 AcpiTableRevision;
+ UINT8 AcpiTableRevision;

/// The minimum supported ACPI table revision.
- UINT32 MinAcpiTableRevision;
+ UINT8 MinAcpiTableRevision;

/// The ACPI table creator ID.
UINT32 CreatorId;
diff --git a/DynamicTablesPkg/Include/StandardNameSpaceObjects.h b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
index 21bb7de4044ffd6f97156f761e30fc1790f11c0c..0ba6b163691ea127ae7a7d57fb5f9fdf84789338 100644
--- a/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
@@ -79,7 +79,7 @@ typedef struct CmAStdObjAcpiTableInfo {
UINT32 AcpiTableSignature;

/// The ACPI table revision
- UINT32 AcpiTableRevision;
+ UINT8 AcpiTableRevision;

/// The ACPI Table Generator ID
ACPI_TABLE_GENERATOR_ID TableGeneratorId;
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



Join devel@edk2.groups.io to automatically receive all group messages.