From a6a060f940f11e9fb4f204e4110c3cee9dbae9ca Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Wed, 24 Jun 2026 14:06:12 +0100 Subject: [PATCH] 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 --- .../Library/ManageabilityTransportSsifLib/SsifCommon.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ManageabilityPkg/Library/ManageabilityTransportSsifLib/SsifCommon.c b/ManageabilityPkg/Library/ManageabilityTransportSsifLib/SsifCommon.c index e82eb545ce..67132c38a9 100644 --- a/ManageabilityPkg/Library/ManageabilityTransportSsifLib/SsifCommon.c +++ b/ManageabilityPkg/Library/ManageabilityTransportSsifLib/SsifCommon.c @@ -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; }