From nobody Tue Feb 10 04:29:49 2026 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+105981+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+105981+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1686328587; cv=none; d=zohomail.com; s=zohoarc; b=CI5HjzwPTaegYaXt36n00oafccgqC8ZtdrztRjkF5CFxR54wpaKRRrplVSNnZsISNhUK36EB6D/DL2XB/P8gf40UkB+43nPruJkv9/xGv+tNyTua+3MBwWaWrriyTENPjn7JLrjdjhmROByrtuK+X9pxdK5EPK7A+ULeFOxLUlU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1686328587; 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=zO2tNvqFWa4X02wlOu+FBKmleO2OILXUUJ8EDLpwLy8=; b=D7XUY28Q9dg7S9p+ozvzHSwxqX7xGOtzKk7e3LrLcFjzg7HpNliHEps8L6xT1uCD0GflIHZGmEsH4wFTrlfUOx+tXmtUMktV+eP7852WGpx21aCHEocmE29kprzDPPT9inTe3Fqx/xBvTanyfmUHanb7kXuxBhOiKfv2yI29+fg= 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+105981+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1686328587313427.0733019007847; Fri, 9 Jun 2023 09:36:27 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Mzg2YY1788612xOW4kcIsv1K; Fri, 09 Jun 2023 09:36:27 -0700 X-Received: from mail-ot1-f67.google.com (mail-ot1-f67.google.com [209.85.210.67]) by mx.groups.io with SMTP id smtpd.web11.12029.1686314012410517782 for ; Fri, 09 Jun 2023 05:33:32 -0700 X-Received: by mail-ot1-f67.google.com with SMTP id 46e09a7af769-6b2a4655352so595543a34.3 for ; Fri, 09 Jun 2023 05:33:32 -0700 (PDT) X-Gm-Message-State: j1DCcW5r0Ul5yVpXzdcdqya4x1787277AA= X-Google-Smtp-Source: ACHHUZ4MVYvk/4sI6QwSIuPHZnGkIKeTBTXMesbB0y/Nb84na0BCwwqLvUmFBzhl1V8qDs6ZwyunVg== X-Received: by 2002:a05:6871:503:b0:1a2:8ebd:7d46 with SMTP id s3-20020a056871050300b001a28ebd7d46mr1070773oal.21.1686314011566; Fri, 09 Jun 2023 05:33:31 -0700 (PDT) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1f24:5b04:3850:5513:420:9d99]) by smtp.gmail.com with ESMTPSA id w1-20020a056870430100b00187e500e7b3sm2033013oah.49.2023.06.09.05.33.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 05:33:31 -0700 (PDT) From: Ranbir Singh To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni Subject: [edk2-devel] [PATCH v2 1/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix SIGN_EXTENSION Coverity issue Date: Fri, 9 Jun 2023 18:03:21 +0530 Message-Id: <20230609123322.191390-2-rsingh@ventanamicro.com> In-Reply-To: <20230609123322.191390-1-rsingh@ventanamicro.com> References: <20230609123322.191390-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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1686328587; bh=zVwQscahf8H6H8fsShtJ/6QMjNgtpfyevdEoY2zqhdQ=; h=Cc:Date:From:Reply-To:Subject:To; b=WEroK0XUcI8FAaPW0GfrTeDgbhtJkZGB2MqwoWplhnRdESti3hz1QXX204IQ/Hx39W2 Dud7vFhOEtSrYqqxif5ybFJBbJWr+Wwv3n0n5uhZl1M3lQlUT+lcl1khpsytRO3NaOGEd nhFq60Bumo7/K9eCWNaXFe8O2v5WL6+xedE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1686328588098100003 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 --- Notes: Retain outer cast 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 (#105981): https://edk2.groups.io/g/devel/message/105981 Mute This Topic: https://groups.io/mt/99432079/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-