mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
ManageabilityPkg: SsifWriteRequest post-refactor cleanup
Now the logic of the function is less convoluted, drop some redundant casts, variable initialisations and move the MiddleCount definition into the only block where it's used. Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
This commit is contained in:
parent
150339f262
commit
a6a060f940
1 changed files with 2 additions and 5 deletions
|
|
@ -59,7 +59,6 @@ SsifWriteRequest (
|
|||
EFI_STATUS Status;
|
||||
BOOLEAN IsMultiPartWrite;
|
||||
UINTN BytesLeft;
|
||||
UINTN MiddleCount;
|
||||
UINT8 SsifCmd;
|
||||
UINTN WriteLen;
|
||||
|
||||
|
|
@ -67,9 +66,6 @@ SsifWriteRequest (
|
|||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
MiddleCount = 0;
|
||||
Status = EFI_SUCCESS;
|
||||
|
||||
if (RequestDataSize > IPMI_SSIF_MAXIMUM_PACKET_SIZE_IN_BYTES) {
|
||||
IsMultiPartWrite = TRUE;
|
||||
|
||||
|
|
@ -82,6 +78,7 @@ SsifWriteRequest (
|
|||
}
|
||||
|
||||
if (IsMultiPartWrite) {
|
||||
UINTN MiddleCount;
|
||||
MiddleCount = ((RequestDataSize - 1) / IPMI_SSIF_MAXIMUM_PACKET_SIZE_IN_BYTES) - 1;
|
||||
|
||||
if ( ((MiddleCount == 0) && (mTransactionSupport == IPMI_GET_SYSTEM_INTERFACE_CAPABILITIES_SSIF_TRANSACTION_SUPPORT_SINGLE_PARTITION_RW))
|
||||
|
|
@ -94,7 +91,7 @@ SsifWriteRequest (
|
|||
WriteLen = IPMI_SSIF_MAXIMUM_PACKET_SIZE_IN_BYTES;
|
||||
SsifCmd = IPMI_SSIF_SMBUS_CMD_MULTI_PART_WRITE_START;
|
||||
} else {
|
||||
WriteLen = (UINT8)RequestDataSize;
|
||||
WriteLen = RequestDataSize;
|
||||
SsifCmd = IPMI_SSIF_SMBUS_CMD_SINGLE_PART_WRITE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue