From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by mx.groups.io with SMTP id smtpd.web09.39655.1658232636804486424 for ; Tue, 19 Jul 2022 05:10:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hXt/o2MW; spf=pass (domain: gmail.com, ip: 209.85.167.45, mailfrom: savvamtr@gmail.com) Received: by mail-lf1-f45.google.com with SMTP id u13so24426607lfn.5 for ; Tue, 19 Jul 2022 05:10:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iyf1hqRT0CLkP/rU+R0Mqc9ILFEj8Cuegpq8ZT8rHVg=; b=hXt/o2MWApo1R/rmp/t9Y6mIXYRUNQuGWy8ghFOUaw4C6y5SrDcPj6c906L/A2Bsbx YmZ5GH1tokuHeGAiKboOkAsNXm9qIOLpYmAv8zijjlshdMUyUhxog+vtbPYw7IK4J2Vr W0z14QB2KyZas5YFaoS0Y+2BMSLp9C0k81N63/9XvGN8NCw/EHTemF5q1MWShsRqu4rJ qQ0ncJovPIZBihBuIM7pvLxVUSKDngBntsCRPSMTLPx6OdBhtx/hdEnj0TZk8c63XWdF sPak9FQ1zDKl+VUAU4bNx3RS3mCffe51b323Hi+gN3uV+Sd7RHXvr6aRTsIn2GYMCXtV 0J9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iyf1hqRT0CLkP/rU+R0Mqc9ILFEj8Cuegpq8ZT8rHVg=; b=N7hAkpWuCr5brj9CheiFt+i4vLd03b888CT7l9NzN6fpg91eaSTqjjbPhuTQZqHfZv xMO9GeHqjGBCj+/eUfhNX/kCe7uUtZQ5PZ85RxFJnSQCzO/my/bQ9Ft+N9Dt4HmRRxaP QxgrwoPGoFoauRTxyAWlOaftzLePqqCL9yK2q354uzVtzOrfjHaAsRfv+4HAIPbeEEQZ ojOA+QnCs+3op4Xn8qWIrYaBbRymUqEI1OLGc3smIEou4BV75Lw7SSVWqMXfYO5SllDC cE5Oha8FvVNkWLLGZClYPxgFMOE6nG0hYjJWKfGoNouzENkiL9Ywj7EViB7otLDKJwXF v7Qw== X-Gm-Message-State: AJIora+jxjeKX7pae+5+mhtVJ+Ol25QGNARurZj3+/iELmh9996060sO NaJlPXiJdccPSQQNL9N53HsNATl2Y8Qo25Trhig= X-Google-Smtp-Source: AGRyM1sYv+L7HxIfYd5aRnZUG1wmjuUGCCBfRVMD1mt0VkaLq0LK8OzGhwpSBdbCsUTiRSoRGZsUXQ== X-Received: by 2002:a05:6512:3c8c:b0:489:e80f:ea33 with SMTP id h12-20020a0565123c8c00b00489e80fea33mr16307833lfv.347.1658232634766; Tue, 19 Jul 2022 05:10:34 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([207.180.219.167]) by smtp.gmail.com with ESMTPSA id z20-20020a2eb534000000b0025d6ecbc897sm2668245ljm.46.2022.07.19.05.10.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 05:10:34 -0700 (PDT) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-platforms][PATCH 02/10] Ext4Pkg: Change HoleLen type to UINT64 Date: Tue, 19 Jul 2022 18:10:08 +0600 Message-Id: <20220719121016.29380-3-savvamtr@gmail.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220719121016.29380-1-savvamtr@gmail.com> References: <20220719121016.29380-1-savvamtr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Set HoleLen to UINT64 to perform safe cast to UINTN in ternary operator at WasRead assignment Cc: Marvin H=C3=A4user Cc: Pedro Falcato Cc: Vitaly Cheptsov Signed-off-by: Savva Mitrofanov --- Features/Ext4Pkg/Ext4Dxe/Inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/Inode.c b/Features/Ext4Pkg/Ext4Dxe/In= ode.c index 142ee6e3d78a..6416f5388486 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Inode.c +++ b/Features/Ext4Pkg/Ext4Dxe/Inode.c @@ -100,7 +100,7 @@ Ext4Read ( EFI_STATUS Status;=0D BOOLEAN HasBackingExtent;=0D UINT32 HoleOff;=0D - UINTN HoleLen;=0D + UINT64 HoleLen;=0D UINT64 ExtentStartBytes;=0D UINT64 ExtentLengthBytes;=0D UINT64 ExtentLogicalBytes;=0D @@ -155,7 +155,7 @@ Ext4Read ( HoleLen =3D (Ext4GetExtentLength (&Extent) * Partition->BlockSize)= - HoleOff;=0D }=0D =0D - WasRead =3D HoleLen > RemainingRead ? RemainingRead : HoleLen;=0D + WasRead =3D HoleLen > RemainingRead ? RemainingRead : (UINTN) HoleLe= n;=0D // Potential improvement: In the future, we could get the file hole'= s total=0D // size and memset all that=0D ZeroMem (Buffer, WasRead);=0D --=20 2.37.0