mirror of
https://github.com/Dasharo/edk2.git
synced 2026-06-13 10:16:24 -07:00
3bc03ff552
Clang complains about unused variables:
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rimt/RimtParser.c:21:60: error: variable 'mRimtNodeHeader' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
21 | STATIC EFI_ACPI_6_6_RIMT_NODE_HEADER_STRUCTURE mRimtNodeHeader;
| ^~~~~~~~~~~~~~~
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rimt/RimtParser.c:25:60: error: variable 'mRimtIdMappingNode' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
25 | STATIC EFI_ACPI_6_6_RIMT_ID_MAPPING_STRUCTURE mRimtIdMappingNode;
| ^~~~~~~~~~~~~~~~~~
28 | STATIC EFI_ACPI_6_6_RIMT_PCIE_ROOT_COMPLEX_NODE_STRUCTURE mRimtPcieRootComplexNode;
| ^~~~~~~~~~~~~~~~~~~~~~~~
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rimt/RimtParser.c:29:60: error: variable 'mRimtIommuNode' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
29 | STATIC EFI_ACPI_6_6_RIMT_IOMMU_NODE_STRUCTURE mRimtIommuNode;
| ^~~~~~~~~~~~~~
4 errors generated.
This is because these variables are only used to take the size of their
fields using the sizeof() operator, which does not support type names
directly.
So create a helper macro SIZE_OF_T () that provides the functionality we
need, and drop the unused variables.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>