From: Ranbir Singh <[email protected]> The return value stored in Status after call to SetDriveParameters is not made of any use thereafter and hence it remains as UNUSED.
Add error check as is done after calls to SetDeviceTransferMode. Cc: Hao A Wu <[email protected]> Cc: Ray Ni <[email protected]> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4204 Signed-off-by: Ranbir Singh <[email protected]> Signed-off-by: Ranbir Singh <[email protected]> --- Notes: Add error check instead of Status storage removal MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c index 75403886e44a..d04b1d95a7f5 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c @@ -2549,13 +2549,18 @@ DetectAndConfigIdeDevice ( // if (DeviceType == EfiIdeHarddisk) { // - // Init driver parameters + // Init drive parameters // DriveParameters.Sector = (UINT8)((ATA5_IDENTIFY_DATA *)(&Buffer.AtaData))->sectors_per_track; DriveParameters.Heads = (UINT8)(((ATA5_IDENTIFY_DATA *)(&Buffer.AtaData))->heads - 1); DriveParameters.MultipleSector = (UINT8)((ATA5_IDENTIFY_DATA *)(&Buffer.AtaData))->multi_sector_cmd_max_sct_cnt; Status = SetDriveParameters (Instance, IdeChannel, IdeDevice, &DriveParameters, NULL); + + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Set Drive Parameters Fail, Status = %r\n", Status)); + continue; + } } // -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105982): https://edk2.groups.io/g/devel/message/105982 Mute This Topic: https://groups.io/mt/99432080/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
