mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
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> |
||
|---|---|---|
| .. | ||
| CapsuleUpdatePolicyDxe | ||
| FmpDxe | ||
| Include | ||
| Library | ||
| PrivateInclude | ||
| Test | ||
| FmpDevicePkg.ci.yaml | ||
| FmpDevicePkg.dec | ||
| FmpDevicePkg.dsc | ||
| FmpDevicePkg.uni | ||
| FmpDevicePkgExtra.uni | ||