From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f196.google.com (mail-oi1-f196.google.com [209.85.167.196]) by mx.groups.io with SMTP id smtpd.web11.17480.1685722143666393213 for ; Fri, 02 Jun 2023 09:09:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=HRZCYCdT; spf=pass (domain: ventanamicro.com, ip: 209.85.167.196, mailfrom: rsingh@ventanamicro.com) Received: by mail-oi1-f196.google.com with SMTP id 5614622812f47-397f13944f2so1930941b6e.0 for ; Fri, 02 Jun 2023 09:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1685722143; x=1688314143; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=iVeQdn539QGbjyRpDhvTu8Ejy6p5/HzdutI+Gz5WG0k=; b=HRZCYCdTvddrqwbk7FmjU5iPrVPzMrwgEr/FLTkEV01KOuMCkz/DCch86MIUiPauKQ vcXnajl0OD77lPMokLp5hv/NjxcB89xx7dUZ85hNssQ69deNBexXUhfwYhlByVQqxEga wCy5NcfQDrYq/+kAGKZwVHB4idBwOBoai55cRf1K/0YnK7vd7bF+d7a7G5XfbFIzQPxG TRJe4cmokSsKxsdPnmDpYd+xdJDxZvQsyIFVoWNzo5Xe9UuR1krJ+sBo/ZDBXJgrKjbK HmDRXtEY+NO85onx5LjcRE+Gwp6T4Ydxuas3PHI1H3zDfw7lGrapbMnw9ucpXutFesko lrhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685722143; x=1688314143; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iVeQdn539QGbjyRpDhvTu8Ejy6p5/HzdutI+Gz5WG0k=; b=MXhh3pec3YzmNRwpHpebswYIghV/ppOuBkfYnlzQgkexQH3bcYFVhv2vXEeiVz/1Ky dpgXVmFbeEDnonMfidEtwfc89I7oeoNTv94DsjVr42YhvLy+Uu3FGP/raYrcJRUzzy17 ZcpE1iSwHJ2gOKqXaJc3ItqdDXYBmKh8uS2bLC5LXkN75xzsluWwLzSwteuthEhb9KVc uQAF6JOMZU3ruZqZ5BjwjvmIrVyb/Dq1kVUHaQVLhiBqN5n5G488HSCjxWqJP/0jmYfC 8PnQl7plUB3LpoLYWiMgjpPNNTeqiX8D/GZ+VfgCJHhpcc6V1Myj3c7lOUjYTeIQSCZG /LwA== X-Gm-Message-State: AC+VfDxWKtHdw0mLBS1ellAU9Im9O7h7DIKrrM91RTixAKX4rswDo9IG Fd5LjC9SEo6z+UXgNX3lBvR163KhzLaSNHrDLB8iSeow X-Google-Smtp-Source: ACHHUZ5aDvj4NwKv4WQ2fW04qpU+IRCN1MEJo/ismFcH9CoE3bAvUpmsrehcV2hI61GGrd38x4LFvg== X-Received: by 2002:a05:6808:5c1:b0:396:40c4:a2ef with SMTP id d1-20020a05680805c100b0039640c4a2efmr375433oij.11.1685722142760; Fri, 02 Jun 2023 09:09:02 -0700 (PDT) Return-Path: Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1cbd:cf0a:bba4:297:e878:3d94]) by smtp.gmail.com with ESMTPSA id v5-20020acade05000000b0039a016ec102sm706837oig.15.2023.06.02.09.08.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 09:09:02 -0700 (PDT) From: Ranbir Singh To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni Subject: [PATCH 1/1] MdeModulePkg/Bus/Ata/AtaBusDxe: Fix SIGN_EXTENSION Coverity issue Date: Fri, 2 Jun 2023 21:38:51 +0530 Message-Id: <20230602160852.98282-1-rsingh@ventanamicro.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Cc: Hao A Wu Cc: Ray Ni REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4209 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..ccd4c5f05b59 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)(IdentifyData->logic_sector_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