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 5D6C59411B7 for ; Tue, 18 Jul 2023 09:02:02 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=84yb6uAtItWfo9Eg5OM8ROcOt7XUFdqwFI1lHe4Q9aM=; 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=1689670921; v=1; b=YzIULePF4QuReW36/639iSoCU/lskXXUle75dkdtnJYpQEpYVGYqyOK7Hp3ZArZkBFWieRgp 8/ns6TaLadHXXUHUuvp7mPffYDLybv8dXv/7VxaeZG1hntg9n+ul6kNnQc2DzWoseGMN+0/IgiH /hDib8jUEl1zkmuIklGrD8VU= X-Received: by 127.0.0.2 with SMTP id rzT5YY7687511x4ZETKpFYi6; Tue, 18 Jul 2023 02:02:01 -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.1428.1689567891425160619 for ; Sun, 16 Jul 2023 21:24:51 -0700 X-Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6726d5d92afso3097947b3a.1 for ; Sun, 16 Jul 2023 21:24:51 -0700 (PDT) X-Gm-Message-State: 5LepCOI6njh5bTqe1evzMRSXx7686176AA= X-Google-Smtp-Source: APBJJlG6/lWCIaD4j8Ltmc44rxUXnjZaIb8H7sroYqhGqSSwPnWiZtDJRFile4HzOD/m7uOuV37ORw== X-Received: by 2002:a05:6a20:3c87:b0:12c:76d1:bcec with SMTP id b7-20020a056a203c8700b0012c76d1bcecmr11599821pzj.20.1689567890779; Sun, 16 Jul 2023 21:24:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jul 2023 21:24:50 -0700 (PDT) From: Ranbir Singh To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni Subject: [edk2-devel] [PATCH v4 1/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix SIGN_EXTENSION Coverity issue Date: Mon, 17 Jul 2023 09:54:43 +0530 Message-Id: <20230717042444.2242552-2-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=YzIULePF; 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 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. 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 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=0D //=0D if ((IdentifyData->AtaData.phy_logic_sector_support & BIT12) !=3D 0) {= =0D - BlockSize =3D (UINT32)(((IdentifyData->AtaData.logic_sector_size_hi = << 16) | IdentifyData->AtaData.logic_sector_size_lo) * sizeof (UINT16));=0D + BlockSize =3D (UINT32)(((UINT32)(IdentifyData->AtaData.logic_sector_= size_hi << 16) | IdentifyData->AtaData.logic_sector_size_lo) * sizeof (UINT= 16));=0D }=0D }=0D =0D --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106989): https://edk2.groups.io/g/devel/message/106989 Mute This Topic: https://groups.io/mt/100212104/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-