* [PATCH 12/14] FmpDevicePkg/FmpDxe: Change where FmpControllerState is updated
@ 2019-08-01 8:47 Eric Jin
0 siblings, 0 replies; only message in thread
From: Eric Jin @ 2019-08-01 8:47 UTC (permalink / raw)
To: devel; +Cc: Sean Brogan, Bret Barkelew, Liming Gao, Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525
In the 4 Setxxx() functions, do not update FmpControllerState
contents unless Update is TRUE. This does not change any
behavior, but it does make the logic easier to understand.
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Eric Jin <eric.jin@intel.com>
---
FmpDevicePkg/FmpDxe/VariableSupport.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/FmpDevicePkg/FmpDxe/VariableSupport.c b/FmpDevicePkg/FmpDxe/VariableSupport.c
index 414a077ab2..a2deff94a5 100644
--- a/FmpDevicePkg/FmpDxe/VariableSupport.c
+++ b/FmpDevicePkg/FmpDxe/VariableSupport.c
@@ -498,11 +498,11 @@ SetVersionInVariable (
if (FmpControllerState->Version != Version) {
Update = TRUE;
}
- FmpControllerState->VersionValid = TRUE;
- FmpControllerState->Version = Version;
if (!Update) {
DEBUG ((DEBUG_INFO, "FmpDxe(%s): No need to update controller state. Same value as before.\n", mImageIdName));
} else {
+ FmpControllerState->VersionValid = TRUE;
+ FmpControllerState->Version = Version;
Status = gRT->SetVariable (
Private->FmpStateVariableName,
&gEfiCallerIdGuid,
@@ -561,11 +561,11 @@ SetLowestSupportedVersionInVariable (
if (FmpControllerState->Lsv < LowestSupportedVersion) {
Update = TRUE;
}
- FmpControllerState->LsvValid = TRUE;
- FmpControllerState->Lsv = LowestSupportedVersion;
if (!Update) {
DEBUG ((DEBUG_INFO, "FmpDxe(%s): No need to update controller state. Same value as before.\n", mImageIdName));
} else {
+ FmpControllerState->LsvValid = TRUE;
+ FmpControllerState->Lsv = LowestSupportedVersion;
Status = gRT->SetVariable (
Private->FmpStateVariableName,
&gEfiCallerIdGuid,
@@ -624,11 +624,11 @@ SetLastAttemptStatusInVariable (
if (FmpControllerState->LastAttemptStatus != LastAttemptStatus) {
Update = TRUE;
}
- FmpControllerState->LastAttemptStatusValid = TRUE;
- FmpControllerState->LastAttemptStatus = LastAttemptStatus;
if (!Update) {
DEBUG ((DEBUG_INFO, "FmpDxe(%s): No need to update controller state. Same value as before.\n", mImageIdName));
} else {
+ FmpControllerState->LastAttemptStatusValid = TRUE;
+ FmpControllerState->LastAttemptStatus = LastAttemptStatus;
Status = gRT->SetVariable (
Private->FmpStateVariableName,
&gEfiCallerIdGuid,
@@ -687,11 +687,11 @@ SetLastAttemptVersionInVariable (
if (FmpControllerState->LastAttemptVersion != LastAttemptVersion) {
Update = TRUE;
}
- FmpControllerState->LastAttemptVersionValid = TRUE;
- FmpControllerState->LastAttemptVersion = LastAttemptVersion;
if (!Update) {
DEBUG ((DEBUG_INFO, "FmpDxe(%s): No need to update controller state. Same value as before.\n", mImageIdName));
} else {
+ FmpControllerState->LastAttemptVersionValid = TRUE;
+ FmpControllerState->LastAttemptVersion = LastAttemptVersion;
Status = gRT->SetVariable (
Private->FmpStateVariableName,
&gEfiCallerIdGuid,
--
2.20.1.windows.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-08-01 8:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-01 8:47 [PATCH 12/14] FmpDevicePkg/FmpDxe: Change where FmpControllerState is updated Eric Jin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox