From nobody Sun May 12 00:47:02 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+106992+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+106992+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1689670923; cv=none; d=zohomail.com; s=zohoarc; b=J4Mmy90sW6LSDut2xPZfY63Hk8pW9bXtd/5fkt25KcfVkswTz+EYWgWqRjBrUaniAia0MihBdgJ29pVgk/D7AmQtid0zUVoeZysxhB0o7YYOcqaTL1xFsVnJZxyNGBnmFR6ZTiW28fJstnaILyVMigOFD84O9tRPWkzGqFLWyqg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689670923; 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=9Py752TvGcZc7BEDsTmgJrHvUr5ZZAkKEllyGJ5UPcs=; b=X06wfCSjXQeQh0JeLWtMrNCEdGPO343ETAMKVNDClVDUWhWbVCmtIQBwqqkiiM7TXoQGbtrddiCVyqe7BT+1ZeF//NQyalL5uF+MKQAohqh/gRhCcS9s8K0OsrtDM3Y/myTLzS69WJtuhWe0VIYqsHuedfZWUmukvCB7I6IgZFk= 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+106992+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 168967092369060.84663183417092; Tue, 18 Jul 2023 02:02:03 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Fo6F7aXnW2pARaKldvaeq0nS8o58hLehWcX1EO/sO/w=; 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=1689670923; v=1; b=gniABbgLfIJnJYNW4Igm8I70/IQr5fLDpfR4FWME/n6ZGeBKrFodq5njyJtRoJF9TJlPpVbp NJKe5nintImoLDPUm4shPYZM1xeBYysUJwczpKPQRlNkJ3c/n24qygASBp5vyTTVYpD9k1dt22i gc7jKa2yovpNAeE7tYI3FMgc= X-Received: by 127.0.0.2 with SMTP id 0MqnYY1788612xcilZzCwMhT; Tue, 18 Jul 2023 02:02:03 -0700 X-Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mx.groups.io with SMTP id smtpd.web11.4253.1689585073658064931 for ; Mon, 17 Jul 2023 02:11:15 -0700 X-Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-666eef03ebdso2689242b3a.1 for ; Mon, 17 Jul 2023 02:11:13 -0700 (PDT) X-Gm-Message-State: NYh1gLbnIjUYzRkbJIh04u5Rx1787277AA= X-Google-Smtp-Source: APBJJlF6dkqIhZVtKhkgEvZc1EmnQ/nLQhn6uR1KzwHfeL2yaV5+dw6Up36010I0+6mB1JAreOXZpA== X-Received: by 2002:a05:6a20:9183:b0:133:a1d8:b2a1 with SMTP id v3-20020a056a20918300b00133a1d8b2a1mr9639959pzd.22.1689585073018; Mon, 17 Jul 2023 02:11:13 -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 i15-20020aa78d8f000000b0068277318e6asm11362356pfr.209.2023.07.17.02.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 02:11:12 -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 14:41:06 +0530 Message-Id: <20230717091106.2272786-2-rsingh@ventanamicro.com> In-Reply-To: <20230717091106.2272786-1-rsingh@ventanamicro.com> References: <20230717091106.2272786-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: 1689670925751100016 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 --- 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 (#106992): https://edk2.groups.io/g/devel/message/106992 Mute This Topic: https://groups.io/mt/100212107/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-