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:
Leif Lindholm 2026-06-24 14:06:12 +01:00 committed by mergify[bot]
parent 150339f262
commit a6a060f940

View file

@ -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;
}