]> git.proxmox.com Git - mirror_edk2.git/commit
DynamicTablesPkg: Fix IORT node length assignment
authorSami Mujawar <sami.mujawar@arm.com>
Tue, 9 Jul 2019 15:50:42 +0000 (16:50 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 29 Mar 2020 16:53:35 +0000 (16:53 +0000)
commit8b2ac43bd8398c3e9559696de3f44ffaf455006e
tree99831be8214530d0046a8302f0ef75f552f689a1
parenteffddeea3978d0fe5b85a310de73e0ea1625a931
DynamicTablesPkg: Fix IORT node length assignment

The VS2017 compiler reports 'warning C4267: 'return': conversion
from 'size_t' to 'UINT32', possible loss of data' for a number of
functions that compute the IORT node length. Similarly, it reports
warnings for IORT node length field assignments as the length
field is 16-bit wide.

This patch adds type casts at appropriate places and also implements
validations to ensure that the max width of the respective fields
is not exceeded.

This patch also fixes a typo in one of the local variable names.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c