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 77DAAAC13C9 for ; Tue, 18 Jul 2023 09:02:16 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=O7xEmFBL9QE0ZxnovZKVxsN0Wy2B4eIgZr/2D75H904=; 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=1689670935; v=1; b=C/fAQVI/xhU2zZB4QJBv74NTCecTxXBmspWZpktJnJuHbAYhufDndlDUCjfVy1U+K2luLo02 wv7Kzldrxb3m2WBuJXvco4W1M73ZjH6cFFeMtnaR4OOZNo0hG8eHG9UzW/BmvQjNuTmxAWHTUIj HfbD1jjhOJkIKh1nI6EqWano= X-Received: by 127.0.0.2 with SMTP id eTsBYY7687511x1ekXTjzmyP; Tue, 18 Jul 2023 02:02:15 -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: deDq5PgRdTIJsMRdmn1YSSV1x7686176AA= 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-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="C/fAQVI/"; 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 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=0D //=0D if ((PhyLogicSectorSupport & BIT12) !=3D 0) {=0D - BlockMedia->BlockSize =3D (UINT32)(((IdentifyData->logic_sector_size= _hi << 16) | IdentifyData->logic_sector_size_lo) * sizeof (UINT16));=0D + BlockMedia->BlockSize =3D (UINT32)(((UINT32)(IdentifyData->logic_sec= tor_size_hi << 16) | IdentifyData->logic_sector_size_lo) * sizeof (UINT16))= ;=0D }=0D =0D AtaDevice->BlockIo.Revision =3D EFI_BLOCK_IO_PROTOCOL_REVISION2;=0D --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- 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/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-