mirror of https://github.com/acidanthera/audk.git
ShellPkg: Tidy for code readability
Use error handling instead of success handling. Less indented logic is easier to read. Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Daniel Nguyen <daniel.nguyen@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
This commit is contained in:
parent
3ce5f2d445
commit
74daeded0c
|
@ -79,7 +79,12 @@ ShellCommandRunReset (
|
|||
&DataSize,
|
||||
&OsIndications
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
ShellStatus = SHELL_UNSUPPORTED;
|
||||
goto Error;
|
||||
}
|
||||
|
||||
if ((OsIndications & EFI_OS_INDICATIONS_BOOT_TO_FW_UI) != 0) {
|
||||
DataSize = sizeof (OsIndications);
|
||||
Status = gRT->GetVariable (
|
||||
|
@ -89,10 +94,11 @@ ShellCommandRunReset (
|
|||
&DataSize,
|
||||
&OsIndications
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
OsIndications |= EFI_OS_INDICATIONS_BOOT_TO_FW_UI;
|
||||
} else {
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
OsIndications = EFI_OS_INDICATIONS_BOOT_TO_FW_UI;
|
||||
} else {
|
||||
OsIndications |= EFI_OS_INDICATIONS_BOOT_TO_FW_UI;
|
||||
}
|
||||
|
||||
Status = gRT->SetVariable (
|
||||
|
@ -103,7 +109,6 @@ ShellCommandRunReset (
|
|||
&OsIndications
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
ShellStatus = SHELL_UNSUPPORTED;
|
||||
|
|
Loading…
Reference in New Issue