summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
diff options
context:
space:
mode:
authorShubham Kumar <kumarshubha@microsoft.com>2026-07-01 13:58:59 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2026-07-20 08:44:52 +0300
commitdc52b0c75bd299ea3bc4c6273d3dfeb26253c001 (patch)
tree2cc5ae29629e2e7a0330b626fcf6aa1ebce30073 /MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
parent5309cdb92c5552e64fce7648ec15d0ab497b1161 (diff)
downloadedk2-dc52b0c75bd299ea3bc4c6273d3dfeb26253c001.tar.xz
FmpDevicePkg/FmpDxe: Reduce NV variable reads for FMP state
In PopulateDescriptor(), each FMP device previously called GetFmpControllerState() multiple times through individual getter functions (GetVersionFromVariable, GetLowestSupportedVersionFromVariable, etc.), each performing a separate GetVariable() call to read the same FmpControllerState NV variable. Rename the getter functions to *FromFmpControllerState and simplify them to pure field extractors that take a required FMP_CONTROLLER_STATE pointer. Each getter extracts the field value if the state is non-NULL and the field is valid, returning a default otherwise. No getter calls GetFmpControllerState() internally. PopulateDescriptor() now calls GetFmpControllerState() once and passes the result to all getters, then frees it after the last use. This eliminates redundant NV reads when the variable exists and avoids repeated failed reads and error messages when the variable does not exist. Signed-off-by: Shubham Kumar <kumarshubha@microsoft.com>
Diffstat (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c')
0 files changed, 0 insertions, 0 deletions