DynamicTablesPkg: fix SmbiosType2Genertor build failure with clang

BaseboardCount type is UINT32. Using MAX_UINTN in the comparision
triggers below build error:

  type 'UINT32' (aka 'unsigned int') is always false
    [-Werror,-Wtautological-constant-out-of-range-compare]
  199 |       (BaseboardCount > (MAX_UINTN / sizeof (*CmObjectList))))

To address this, use MAX_UINT32 instead of MAX_UINTN.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
This commit is contained in:
Yeoreum Yun 2026-08-10 15:40:06 +01:00 committed by pierregondois
parent cc9a0425a2
commit 193216cbfc

View file

@ -195,8 +195,8 @@ BuildSmbiosType2TableEx (
}
if ((BaseboardInfo == NULL) ||
(BaseboardCount > (MAX_UINTN / sizeof (*TableList))) ||
(BaseboardCount > (MAX_UINTN / sizeof (*CmObjectList))))
(BaseboardCount > (MAX_UINT32 / sizeof (*TableList))) ||
(BaseboardCount > (MAX_UINT32 / sizeof (*CmObjectList))))
{
DEBUG ((DEBUG_ERROR, "%a: Invalid Baseboard object list\n", __func__));
return EFI_INVALID_PARAMETER;