From: "Wu, Hao A" <hao.a.wu@intel.com>
To: Ranbir Singh <rsingh@ventanamicro.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Ni, Ray" <ray.ni@intel.com>
Subject: Re: [edk2-devel] [PATCH v4 2/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix UNUSED_VALUE Coverity issue
Date: Mon, 31 Jul 2023 01:48:43 +0000 [thread overview]
Message-ID: <DM6PR11MB402552D56BF3E992713AE99ACA05A@DM6PR11MB4025.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230717042444.2242552-3-rsingh@ventanamicro.com>
> -----Original Message-----
> From: Ranbir Singh <rsingh@ventanamicro.com>
> Sent: Monday, July 17, 2023 12:25 PM
> To: devel@edk2.groups.io; rsingh@ventanamicro.com
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH v4 2/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix
> UNUSED_VALUE Coverity issue
>
> From: Ranbir Singh <Ranbir.Singh3@Dell.com>
>
> The return value stored in Status after call to SetDriveParameters
> is not made of any use thereafter and hence it remains as UNUSED.
>
> Based on Hao's findings (https://edk2.groups.io/g/devel/message/106844),
> the successful execution of SetDriveParameters() is not mandatory for
> initializing IDE mode of a hard disk device. Hence remove the 'Status'
> assignment of the return value from SetDriveParameters() and instead add
> error checks & DEBUG_WARN level messages within SetDriveParameters()
> function after sending INIT_DRIVE_PARAM & SET_MULTIPLE_MODE ATA
> commands.
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Best Regards,
Hao Wu
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4204
>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Ranbir Singh <Ranbir.Singh3@Dell.com>
> Signed-off-by: Ranbir Singh <rsingh@ventanamicro.com>
> ---
> MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c
> b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c
> index 75403886e44a..19d7b4930cb7 100644
> --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c
> +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c
> @@ -1992,6 +1992,10 @@ SetDriveParameters (
> NULL
>
> );
>
>
>
> + if (EFI_ERROR (Status)) {
>
> + DEBUG ((DEBUG_WARN, "Init Drive Parameters Fail, Status = %r\n",
> Status));
>
> + }
>
> +
>
> //
>
> // Send Set Multiple parameters
>
> //
>
> @@ -2008,6 +2012,10 @@ SetDriveParameters (
> NULL
>
> );
>
>
>
> + if (EFI_ERROR (Status)) {
>
> + DEBUG ((DEBUG_WARN, "Set Multiple Mode Parameters Fail, Status
> = %r\n", Status));
>
> + }
>
> +
>
> return Status;
>
> }
>
>
>
> @@ -2549,13 +2557,13 @@ 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);
>
> + SetDriveParameters (Instance, IdeChannel, IdeDevice, &DriveParameters,
> NULL);
>
> }
>
>
>
> //
>
> --
> 2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107388): https://edk2.groups.io/g/devel/message/107388
Mute This Topic: https://groups.io/mt/100212105/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2023-07-31 1:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 4:24 [edk2-devel] [PATCH v4 0/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix Ranbir Singh
2023-07-17 4:24 ` [edk2-devel] [PATCH v4 1/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix SIGN_EXTENSION Coverity issue Ranbir Singh
2023-07-17 4:24 ` [edk2-devel] [PATCH v4 2/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix UNUSED_VALUE " Ranbir Singh
2023-07-31 1:48 ` Wu, Hao A [this message]
2023-08-02 3:16 ` [edk2-devel] [PATCH v4 0/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix Wu, Hao A
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DM6PR11MB402552D56BF3E992713AE99ACA05A@DM6PR11MB4025.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox