Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: dc52b0c75bd299ea3bc4c6273d3dfeb26253c001
      
https://github.com/tianocore/edk2/commit/dc52b0c75bd299ea3bc4c6273d3dfeb26253c001
  Author: Shubham Kumar <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    M FmpDevicePkg/FmpDxe/FmpDxe.c
    M FmpDevicePkg/FmpDxe/VariableSupport.c
    M FmpDevicePkg/FmpDxe/VariableSupport.h

  Log Message:
  -----------
  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 <[email protected]>



To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to