From nobody Sat May 11 17:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106918+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106918+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1689268033; cv=none; d=zohomail.com; s=zohoarc; b=AQLDBhMV67fh1bPBWfDnBACbdBtfNoj7v/AyMGWoc1M86f35pZWbxVwUXmsRFy9a1VngGTOqkMntJw9Ar5NFaX2F9m4zTnNIVqayQIzzL8sLXsRkjAyNH0Xd4md0eAxIhJ21+2AXinnZT/GogoHj9FoPWSuUKczQ7GXOdcYiTzI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689268033; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=JyZa19wUjbUdcJcl7TldGM4NrigVWsluoGeplLrxTCQ=; b=XZcNJCiOkxj2yyPL4Zu+YeP+JhgtqbGbKUDnNJ5NFDtFWicvpqjTfu6LIlZAH0rAUI40p2aS6gxiEOd/y1LiT/y3/qIwoiCwjGfhiAat6OSj2nx6zD2hCByjC7YJojM0o8a1S17c707qJxl4rpgtjxFQutLWTnj7yr4dnrPL1Y8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106918+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 168926803346445.70735920389461; Thu, 13 Jul 2023 10:07:13 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Qm8r1nW2E3436QhAluSlaCQ07jAIwlU4H9BMk3MjcnI=; 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=1689268033; v=1; b=s15zWaO8D2L05zoCw+kbX8ydeVr1XoaNJNFC7vJuffxxBOHmbTWi+2PoIIOURYUdhVk/WTHs MviULuVPPtHJQkvWGYQpi+Q9/EbD1PYNCP2r5NYvakal0B10McMmhpkfUpLLIqw/owbv8j3vUQR oqTYZtlZ9dxXL+iOUJrTxPzM= X-Received: by 127.0.0.2 with SMTP id aPAlYY1788612x7xLWNyZtoD; Thu, 13 Jul 2023 10:07:13 -0700 X-Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mx.groups.io with SMTP id smtpd.web11.1836.1689266843600189876 for ; Thu, 13 Jul 2023 09:47:23 -0700 X-Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-666ecf9a0ceso640108b3a.2 for ; Thu, 13 Jul 2023 09:47:23 -0700 (PDT) X-Gm-Message-State: NRmAfTB5N8ZOw1O2YfnvOFPQx1787277AA= X-Google-Smtp-Source: APBJJlGY+h6/GMFYQ0Ayi96HnZa//OS4+WOmaBewKQYgDNUa6TfZxqpFUEhTN8vZzmg3W1RhHon9Ag== X-Received: by 2002:a17:902:b68f:b0:1b9:e9f3:44c3 with SMTP id c15-20020a170902b68f00b001b9e9f344c3mr1450757pls.4.1689266842952; Thu, 13 Jul 2023 09:47:22 -0700 (PDT) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1cbd:8dd2:35e7:16dd:8a1f:72c5]) by smtp.gmail.com with ESMTPSA id x13-20020a170902b40d00b001b8c3c7b102sm6190320plr.127.2023.07.13.09.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jul 2023 09:47:22 -0700 (PDT) From: Ranbir Singh To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni Subject: [edk2-devel] [PATCH v3 1/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix SIGN_EXTENSION Coverity issue Date: Thu, 13 Jul 2023 22:17:14 +0530 Message-Id: <20230713164715.1734745-2-rsingh@ventanamicro.com> In-Reply-To: <20230713164715.1734745-1-rsingh@ventanamicro.com> References: <20230713164715.1734745-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-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1689268057835100001 Content-Type: text/plain; charset="utf-8" From: Ranbir Singh Line number 1348 does contain a typecast with UINT32, but it is after all the operations (16-bit left shift followed by OR'ing) are over. To avoid any SIGN_EXTENSION, typecast the intermediate result after 16-bit left shift operation immediately with UINT32. Cc: Hao A Wu Cc: Ray Ni REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4204 Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh Reviewed-by: Hao A Wu --- MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/Mde= ModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c index 50406fe0270d..f39c909d0631 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c @@ -1345,7 +1345,7 @@ AtaPassThruPassThru ( // Check logical block size // if ((IdentifyData->AtaData.phy_logic_sector_support & BIT12) !=3D 0) { - BlockSize =3D (UINT32)(((IdentifyData->AtaData.logic_sector_size_hi = << 16) | IdentifyData->AtaData.logic_sector_size_lo) * sizeof (UINT16)); + BlockSize =3D (UINT32)(((UINT32)(IdentifyData->AtaData.logic_sector_= size_hi << 16) | IdentifyData->AtaData.logic_sector_size_lo) * sizeof (UINT= 16)); } } =20 --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106918): https://edk2.groups.io/g/devel/message/106918 Mute This Topic: https://groups.io/mt/100124816/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat May 11 17:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106919+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106919+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1689268033; cv=none; d=zohomail.com; s=zohoarc; b=BazBDEgnidDVr5nf5D70k/YQdEaRWSfwRwMRHSGGHIhudzv/NPZ597+Mqxf1w/TP0D4qyYiYQ59rNXHAPOHtDk3hMp4B5jX6XTE07YBDdvFivPqBgnREbdD7TXSdS78gpdSHMalHRajJ8DfEATkevpUrNyunBKMbmPPt+Y/afnw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689268033; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=8O0paxyl/6YzcsPkX7YhPdxGfHbEFaZ1H+gBAyAd1gA=; b=GbFF8E2DBhy+Vi0Itaxo2sc4MZbAxxRsohYKrDxii3phYh3D6b//cprLnn6s/MwbScC16ksyiQqSBbIFCTWMmvySt81YyCusPxGOEeELD6P/+zDeOIj/cuA7hk0Varr7rECm/cEJjinnoDmjArnVFCFT5u3NzVX7QxiPXhD97x8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106919+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1689268033005380.771520572486; Thu, 13 Jul 2023 10:07:13 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=pVeWhC66fTUKhuvcSZUNwXtGslhUbtX9GeLdZKFy8vA=; 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=1689268032; v=1; b=J8jL8BUc0OLiw1rP/tHJnFB98i7OFIoaVMG9MvQ2dbl4u5o8NqW7QofJ+IH3zvyyhXtNKVIK N+KlzLRvI8PsY3n7919BuCHJeiP92Iw5pg+wWMFh4EUhGOv7r7ME6JG9Q8ynW8D2R+YJnTydook M0EDYwoZo8x8Dvj8q3xRLAmQ= X-Received: by 127.0.0.2 with SMTP id s6JuYY1788612xShJFdXLy2b; Thu, 13 Jul 2023 10:07:12 -0700 X-Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mx.groups.io with SMTP id smtpd.web11.1838.1689266846001078721 for ; Thu, 13 Jul 2023 09:47:26 -0700 X-Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-66869feb7d1so641236b3a.3 for ; Thu, 13 Jul 2023 09:47:25 -0700 (PDT) X-Gm-Message-State: osTe3kRTkkZg8dDk26dj8oM6x1787277AA= X-Google-Smtp-Source: APBJJlHNj0xkaqDYNxawyD4z9tRzEKD25zRGHi+g3nqAOtWN2AGmNcu1r2GSaS089wSad6DrLClFew== X-Received: by 2002:a17:902:d485:b0:1b1:9802:a31b with SMTP id c5-20020a170902d48500b001b19802a31bmr1568947plg.41.1689266845311; Thu, 13 Jul 2023 09:47:25 -0700 (PDT) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1cbd:8dd2:35e7:16dd:8a1f:72c5]) by smtp.gmail.com with ESMTPSA id x13-20020a170902b40d00b001b8c3c7b102sm6190320plr.127.2023.07.13.09.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jul 2023 09:47:25 -0700 (PDT) From: Ranbir Singh To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni Subject: [edk2-devel] [PATCH v3 2/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix UNUSED_VALUE Coverity issue Date: Thu, 13 Jul 2023 22:17:15 +0530 Message-Id: <20230713164715.1734745-3-rsingh@ventanamicro.com> In-Reply-To: <20230713164715.1734745-1-rsingh@ventanamicro.com> References: <20230713164715.1734745-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-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1689268033569100004 Content-Type: text/plain; charset="utf-8" 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. Add error check as is done after calls to SetDeviceTransferMode. Cc: Hao A Wu Cc: Ray Ni REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4204 Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh --- MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c b/MdeModulePkg= /Bus/Ata/AtaAtapiPassThru/IdeMode.c index 75403886e44a..af022139cf02 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c @@ -2549,13 +2549,21 @@ DetectAndConfigIdeDevice ( // if (DeviceType =3D=3D EfiIdeHarddisk) { // - // Init driver parameters + // Init drive parameters // DriveParameters.Sector =3D (UINT8)((ATA5_IDENTIFY_DATA *)(&B= uffer.AtaData))->sectors_per_track; DriveParameters.Heads =3D (UINT8)(((ATA5_IDENTIFY_DATA *)(&= Buffer.AtaData))->heads - 1); DriveParameters.MultipleSector =3D (UINT8)((ATA5_IDENTIFY_DATA *)(&B= uffer.AtaData))->multi_sector_cmd_max_sct_cnt; =20 Status =3D SetDriveParameters (Instance, IdeChannel, IdeDevice, &Dri= veParameters, NULL); + + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_WARN, "Set Drive Parameters Fail, Status =3D %r\n", = Status)); + // + // Ignore warning and proceed normally + // + Status =3D EFI_SUCCESS; + } } =20 // --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106919): https://edk2.groups.io/g/devel/message/106919 Mute This Topic: https://groups.io/mt/100124817/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-