From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f68.google.com (mail-oa1-f68.google.com [209.85.160.68]) by mx.groups.io with SMTP id smtpd.web10.6957.1685689793566936254 for ; Fri, 02 Jun 2023 00:09:53 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@ventanamicro.com header.s=google header.b=K4kCMOTb; spf=pass (domain: ventanamicro.com, ip: 209.85.160.68, mailfrom: rsingh@ventanamicro.com) Received: by mail-oa1-f68.google.com with SMTP id 586e51a60fabf-19f268b1d83so1565639fac.1 for ; Fri, 02 Jun 2023 00:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1685689792; x=1688281792; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZW+kLe1WeV6qox/aMimr/EdoDOWiiRLHy+OKYBrndXQ=; b=K4kCMOTbsAhl4ooHf0SFI/bKCV0yeKUZEmX0Rn3lcib1URp4rcloxis4bAWmh84Dw1 uj1/m+3S1BJqiJ4YxxfeRgmw7DoIkspzqSYG7C9S1Naeq2cntfITdv5E0LrhlkZ69UtY Hk0S3+CbkBKQMvTkX/7NXnr/4kPZfQxyzLR35lS1X+KQwnpb7LRNeWspL+VLEX/hSwDu 67A2oCBT8oXXvt0KyQ5NIlbLocNIh72wAaKOFksv6erLxOaRdtId33gbpsF2SJ/tfYfY 5OG32nWw/MW4ATdM30v34fcqikcOwDtQ7Fk0++0SxYi74XBUbGIptCoVGuIsE592RQA9 WcJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685689792; x=1688281792; 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=ZW+kLe1WeV6qox/aMimr/EdoDOWiiRLHy+OKYBrndXQ=; b=St4azy5ETaW7XzF0JDQQ1XMvGvQ/ZIKPKfsQgYwRlY+TageFy9w3x6f69ttysDZDx0 ALFeQuJmmkFAv7/KQtfytXldZX7b2IIIlAKKFX6CYdeyrT4y768vNe6cuNvEHf7rsEur sCFMP0D6YBN9LJQwkGeqAaC0rSeofHXr9a7NwlwcgEySS+WnIWhg2ivfyRs3OiAfN6qM S76ilwQoxfd6DGIN/uQpi7PC0eaDqPSIhGxpMtGEb43rowb5htWgDyz4YH8lfWhvUCv/ lngzKUlYxNnqrjBI5yInYMw3yacuw57JRCfK5p1OBO68DQoBVDzgrJPcGHmH1dSdYk20 vrjQ== X-Gm-Message-State: AC+VfDyHsgawC2FXvMlP1QCr0teganQ2BqDmojZfSU4BHlqNrQIpx5ov VixKxs9lbp89IutJPB8rp2HduLmTCNl+zTEScF4UTWnJ X-Google-Smtp-Source: ACHHUZ7v8soLqw2/5C1yesM0IEhqtMLpO6tVdqgi4gaY0kqLGCwuc9MKOcvaBVL+dQi8mSfp08D5Kw== X-Received: by 2002:a05:6870:a441:b0:18f:11c7:9404 with SMTP id n1-20020a056870a44100b0018f11c79404mr1013936oal.38.1685689792635; Fri, 02 Jun 2023 00:09:52 -0700 (PDT) Return-Path: Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1cbd:cf0a:3d37:338a:2fdd:c49e]) by smtp.gmail.com with ESMTPSA id u17-20020a05687004d100b0019f4f5c8298sm342390oam.56.2023.06.02.00.09.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 00:09:52 -0700 (PDT) From: Ranbir Singh To: devel@edk2.groups.io Cc: Hao A Wu , Ray Ni Subject: [PATCH 1/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix SIGN_EXTENSION Coverity issue Date: Fri, 2 Jun 2023 12:39:45 +0530 Message-Id: <20230602070946.83730-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 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. Cc: Hao A Wu Cc: Ray Ni REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4204 Signed-off-by: Ranbir Singh --- 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..70c4ca27dc68 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)(IdentifyData->AtaData.logic_sector_size_hi = << 16) | IdentifyData->AtaData.logic_sector_size_lo) * sizeof (UINT16));=0D }=0D }=0D =0D --=20 2.34.1