From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 3D88CAC1577 for ; Tue, 18 Jul 2023 09:02:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Bgumi09jbM5I2TOnEW/35EHN0Q9DRkkkxHV6jzivy48=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-Received:X-Gm-Message-State:X-Google-Smtp-Source:X-Received:X-Received:From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Unsubscribe:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:Content-Transfer-Encoding; s=20140610; t=1689670922; v=1; b=OKqxiB+WjeKvaLjLPQynsWfww1iUcnTBxn7sjQes4tMsomWYQmvPA4yd8GMvjFVlxCmGs40p eREkQRZBtpSXVhLm8R1b4vqGFf7ZIhLy+YTDve+dGZcGc7vknNzZiADnELlUy9hz8WHuyckg4Y6 QfjTzCrKthbcZwgSx1LuE9Qo= X-Received: by 127.0.0.2 with SMTP id qohuYY7687511xdyzWncU19V; Tue, 18 Jul 2023 02:02:02 -0700 X-Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mx.groups.io with SMTP id smtpd.web10.1426.1689567893708758020 for ; Sun, 16 Jul 2023 21:24:53 -0700 X-Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-66c729f5618so4200386b3a.1 for ; Sun, 16 Jul 2023 21:24:53 -0700 (PDT) X-Gm-Message-State: 4cLWvPA4YoRewxW3vwLTEK7Vx7686176AA= X-Google-Smtp-Source: APBJJlF/+GvFbH7zxZxhfWWPbpqMNqwVHNjMB7kcq70SacRnmoCDNK3c1Fw/LE9o+lK9FNzw+m5Z9A== X-Received: by 2002:a05:6a00:10c3:b0:67a:b045:e290 with SMTP id d3-20020a056a0010c300b0067ab045e290mr14312442pfu.4.1689567892898; Sun, 16 Jul 2023 21:24:52 -0700 (PDT) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1cbd:8dd2:c2bf:93e0:5979:e5e0]) by smtp.gmail.com with ESMTPSA id f10-20020a63de0a000000b0055c090df2fasm11537914pgg.93.2023.07.16.21.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jul 2023 21:24:52 -0700 (PDT) From: Ranbir Singh To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni Subject: [edk2-devel] [PATCH v4 2/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix UNUSED_VALUE Coverity issue Date: Mon, 17 Jul 2023 09:54:44 +0530 Message-Id: <20230717042444.2242552-3-rsingh@ventanamicro.com> In-Reply-To: <20230717042444.2242552-1-rsingh@ventanamicro.com> References: <20230717042444.2242552-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rsingh@ventanamicro.com Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=OKqxiB+W; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io From: Ranbir Singh 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. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4204 Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh --- 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=0D );=0D =0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_WARN, "Init Drive Parameters Fail, Status =3D %r\n", Sta= tus));=0D + }=0D +=0D //=0D // Send Set Multiple parameters=0D //=0D @@ -2008,6 +2012,10 @@ SetDriveParameters ( NULL=0D );=0D =0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_WARN, "Set Multiple Mode Parameters Fail, Status =3D %r\= n", Status));=0D + }=0D +=0D return Status;=0D }=0D =0D @@ -2549,13 +2557,13 @@ DetectAndConfigIdeDevice ( //=0D if (DeviceType =3D=3D EfiIdeHarddisk) {=0D //=0D - // Init driver parameters=0D + // Init drive parameters=0D //=0D DriveParameters.Sector =3D (UINT8)((ATA5_IDENTIFY_DATA *)(&B= uffer.AtaData))->sectors_per_track;=0D DriveParameters.Heads =3D (UINT8)(((ATA5_IDENTIFY_DATA *)(&= Buffer.AtaData))->heads - 1);=0D DriveParameters.MultipleSector =3D (UINT8)((ATA5_IDENTIFY_DATA *)(&B= uffer.AtaData))->multi_sector_cmd_max_sct_cnt;=0D =0D - Status =3D SetDriveParameters (Instance, IdeChannel, IdeDevice, &Dri= veParameters, NULL);=0D + SetDriveParameters (Instance, IdeChannel, IdeDevice, &DriveParameter= s, NULL);=0D }=0D =0D //=0D --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106990): https://edk2.groups.io/g/devel/message/106990 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] -=-=-=-=-=-=-=-=-=-=-=-