From nobody Sun May 12 19:05:34 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+107005+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+107005+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1689670930; cv=none; d=zohomail.com; s=zohoarc; b=mXuyZ3BJXWyxEyrantH6/5KR3ibQ1XuvszUwlaEd8RxUuG0gjGtKZHy3Wxt/mK8CA5FUMEd4Sq/FF5Sh1aLTjL8l+V4t6FTH/V2B/D09wI8OXpt73irhtIxx/ohexZRNnc+TmWysWhQ4ngvAugdq7+9n6b0q2ErKHjbJ7d1jy1c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689670930; 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=FD6TImF4uRVtX0pc0an+bs5qU8c5ksUoFrQCBtqYYU8=; b=aZPAkIx4+Q1LjgRSNqIhI6O69DWh7//wbwl+gNRmmURLkxmrv2fCGwgIkOaoXM43ASnC3JF+x0ykgnYPjcfhztedwd+OZrjsR3/VBB8a+gSbQBsVT+t3+yLPqxa0B397cj79A4dSZeV3RecJxtFOtnxO+jxaTJYQgcwc3BSn/I4= 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+107005+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1689670930389157.1292475135682; Tue, 18 Jul 2023 02:02:10 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=1g5m3PRkYdyhNQGd7I1td2ryzUTydHvOudG0KWUD0wk=; 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=1689670930; v=1; b=bSBdFN7kC6CS5RRmcaxC83HYm0rxzZ9YfFDfkgvlMGCkxDtaSRR+14oijqb9i+8a/erimVP1 EZDfd7iy6jQYL2ow2uH4JFPGTGTo9tVgowJEYquc4hWIIV0JWI0pzJCAimVctzIER3yTpiEvu5m 1t94fqTBAExHdKPA3MbgF6vM= X-Received: by 127.0.0.2 with SMTP id QhqZYY1788612x8tlSDxMbzM; Tue, 18 Jul 2023 02:02:10 -0700 X-Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by mx.groups.io with SMTP id smtpd.web11.6414.1689595157187129289 for ; Mon, 17 Jul 2023 04:59:17 -0700 X-Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-668709767b1so3097696b3a.2 for ; Mon, 17 Jul 2023 04:59:17 -0700 (PDT) X-Gm-Message-State: Zs3jo0ojVpnqGPHuFEUsvXsZx1787277AA= X-Google-Smtp-Source: APBJJlH8cCrRNYeqdZUgiMkGRKWElsdktzvIFaAoWwOX293GEL6Awto+f9ioNKYjurI+SMmn2SA/Nw== X-Received: by 2002:a17:902:ecc6:b0:1bb:141c:3034 with SMTP id a6-20020a170902ecc600b001bb141c3034mr10722544plh.12.1689595156599; Mon, 17 Jul 2023 04:59:16 -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 s2-20020a170902ea0200b001b9fdeead86sm10299650plg.68.2023.07.17.04.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 04:59:16 -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/1] MdeModulePkg/Bus/Ata/AtaBusDxe: Fix SIGN_EXTENSION Coverity issue Date: Mon, 17 Jul 2023 17:29:10 +0530 Message-Id: <20230717115910.2291824-2-rsingh@ventanamicro.com> In-Reply-To: <20230717115910.2291824-1-rsingh@ventanamicro.com> References: <20230717115910.2291824-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: 1689670932470100044 Content-Type: text/plain; charset="utf-8" From: Ranbir Singh Line number 365 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. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4209 Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh Reviewed-by: Hao A Wu --- MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c b/MdeModul= ePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c index a77852bae054..57aefa04c215 100644 --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c @@ -362,7 +362,7 @@ IdentifyAtaDevice ( // Check logical block size // if ((PhyLogicSectorSupport & BIT12) !=3D 0) { - BlockMedia->BlockSize =3D (UINT32)(((IdentifyData->logic_sector_size= _hi << 16) | IdentifyData->logic_sector_size_lo) * sizeof (UINT16)); + BlockMedia->BlockSize =3D (UINT32)(((UINT32)(IdentifyData->logic_sec= tor_size_hi << 16) | IdentifyData->logic_sector_size_lo) * sizeof (UINT16)); } =20 AtaDevice->BlockIo.Revision =3D EFI_BLOCK_IO_PROTOCOL_REVISION2; --=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 (#107005): https://edk2.groups.io/g/devel/message/107005 Mute This Topic: https://groups.io/mt/100212118/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-