From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mx.groups.io with SMTP id smtpd.web09.30598.1662417457727395190 for ; Mon, 05 Sep 2022 15:37:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dQuLQUKE; spf=pass (domain: gmail.com, ip: 209.85.214.182, mailfrom: pedro.falcato@gmail.com) Received: by mail-pl1-f182.google.com with SMTP id iw17so2913044plb.0 for ; Mon, 05 Sep 2022 15:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=VbO+n1ZpJt+SxAVrsIBIXBJzq4WB6/mrRONoOaN1xb8=; b=dQuLQUKES8vpTi2DLrbmKa8CWmNwG96QlKyx+Okc4XtzNqsMoVs5YuDefCEFRrepSG GonEm42rc3LaDFwzy8ZpjH+zi1L4X9PFHHKyv7+NZXfK+GpY23nbzmqALW5bBmCAYrMM NV+lvVdtNGSXjLjGI5lqcUkHSVJIpAST9hRea2FtmnjoEptk/7iyQYNbToT8aXVSHRnr 3K8halcP9UIPQWP8of6bvFZz2MOGxywjtjyc+971NXGrtEYrYDkhwtnGd2kFxk/GL0xU 1zeFkoP0bn6c5V/Q5bjzAXgxBj7n9ARllW1fXi+NmlP8/IcQQKvoQIesuIw6uZWfsXD+ 9xkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=VbO+n1ZpJt+SxAVrsIBIXBJzq4WB6/mrRONoOaN1xb8=; b=Q1nGRZeeoVGxGrY1E/RH674mOzlUoLybkwkrSYpHZ3hSPROcsZIe6cxK5KXV6QBZZ1 xKTo5Mmu/F36DlMP6xpe92HHQMPgrN81pD5hEsOb+ETCXMzhb+qvDi3MqqsvT4KUan1Y FpVqj9RVuY8mngfPN6+rtgjB9TwGt6DSnu8mV2v+w1OQFF85dO2EIEesSbiKHO/uAnr3 ES4uM3d5QLU4juFUcDoLgao9KXT1p2KxcqZz7sfzn4y9ToEbAg2ubRDjnZVDPkpCSUXA 8ivkVGa+OzTbx474Arj/u3XhFQVYYQXJ0aUjdmo32BS3N3vXnEmm0nJCLZnKkOyrFmGd etmw== X-Gm-Message-State: ACgBeo26ly9vwoZF53KC8L1q+yHjLWpI4y05KlgnKfcL5JTEahZ0vgnC PYJvi9VKoNCAwR5PO30Psi68/ArOpwcwnwDb5Hk= X-Google-Smtp-Source: AA6agR7DPiC8vw9+/kcUm6TD/MRbtG9jCJCdSyvluuRd66Lxeb61aK9dTWfqROEsfhlHtYmQ0TJZi5gR1QfwHO8rsWk= X-Received: by 2002:a17:903:2406:b0:174:f1c8:76bc with SMTP id e6-20020a170903240600b00174f1c876bcmr36405013plo.168.1662417457197; Mon, 05 Sep 2022 15:37:37 -0700 (PDT) MIME-Version: 1.0 References: <20220905015823.33518-1-pedro.falcato@gmail.com> <34CAF6AE-E0C9-4703-9A7D-8E9E302E3833@posteo.de> In-Reply-To: <34CAF6AE-E0C9-4703-9A7D-8E9E302E3833@posteo.de> From: "Pedro Falcato" Date: Mon, 5 Sep 2022 23:37:24 +0100 Message-ID: Subject: Re: [PATCH 1/1] Ext4Pkg: Fix bug in EXT4_HAS_GDT_CSUM To: =?UTF-8?Q?Marvin_H=C3=A4user?= Cc: edk2-devel-groups-io Content-Type: multipart/alternative; boundary="00000000000001364c05e7f5ba32" --00000000000001364c05e7f5ba32 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Pushed as bcad50b On Mon, Sep 5, 2022 at 7:19 AM Marvin H=C3=A4user wrot= e: > > > > On 5. Sep 2022, at 03:58, Pedro Falcato wrote= : > > > > =EF=BB=BFCatched when running clang-tidy on this code. Also tidies up s= ome logic > > in BlockGroup.c > > Caught > > Reviewed-by: Marvin H=C3=A4user > > > > > Cc: Marvin H=C3=A4user > > Signed-off-by: Pedro Falcato > > --- > > Features/Ext4Pkg/Ext4Dxe/BlockGroup.c | 4 ++-- > > Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h | 2 +- > > 2 files changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c > b/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c > > index 572e8f60ab92..cba96cd95afc 100644 > > --- a/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c > > +++ b/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c > > @@ -218,9 +218,9 @@ Ext4CalculateBlockGroupDescChecksum ( > > IN UINT32 BlockGroupNum > > ) > > { > > - if ((Partition->FeaturesRoCompat & > EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) !=3D 0) { > > + if (EXT4_HAS_METADATA_CSUM (Partition)) { > > return Ext4CalculateBlockGroupDescChecksumMetadataCsum (Partition, > BlockGroupDesc, BlockGroupNum); > > - } else if ((Partition->FeaturesRoCompat & > EXT4_FEATURE_RO_COMPAT_GDT_CSUM) !=3D 0) { > > + } else if (EXT4_HAS_GDT_CSUM (Partition)) { > > return Ext4CalculateBlockGroupDescChecksumGdtCsum (Partition, > BlockGroupDesc, BlockGroupNum); > > } > > > > diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h > b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h > > index b446488b2112..81e59a4babc9 100644 > > --- a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h > > +++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h > > @@ -1095,7 +1095,7 @@ Ext4CalculateBlockGroupDescChecksum ( > > @return TRUE if the gdt_csum is supported, else FALSE. > > **/ > > #define EXT4_HAS_GDT_CSUM(Partition) > \ > > - EXT4_HAS_RO_COMPAT(Partition, EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) > > + EXT4_HAS_RO_COMPAT(Partition, EXT4_FEATURE_RO_COMPAT_GDT_CSUM) > > > > /** > > Retrieves the volume name. > > -- > > 2.37.3 > > > > --=20 Pedro Falcato --00000000000001364c05e7f5ba32 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Pushed as bcad50b

On Mon, Sep 5, 2022 at 7:19 AM Marvin H=C3=A4user <mhaeuser@posteo.de> wrote:


> On 5. Sep 2022, at 03:58, Pedro Falcato <pedro.falcato@gmail.com> wrote: >
> =EF=BB=BFCatched when running clang-tidy on this code. Also tidies up = some logic
> in BlockGroup.c

Caught

Reviewed-by: Marvin H=C3=A4user <mhaeuser@posteo.de>

>
> Cc: Marvin H=C3=A4user <mhaeuser@posteo.de>
> Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
> ---
> Features/Ext4Pkg/Ext4Dxe/BlockGroup.c | 4 ++--
> Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h=C2=A0 =C2=A0 | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c b/Features/Ext4Pkg/= Ext4Dxe/BlockGroup.c
> index 572e8f60ab92..cba96cd95afc 100644
> --- a/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c
> +++ b/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c
> @@ -218,9 +218,9 @@ Ext4CalculateBlockGroupDescChecksum (
>=C2=A0 =C2=A0IN UINT32=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0BlockGroupNum
>=C2=A0 =C2=A0)
> {
> -=C2=A0 if ((Partition->FeaturesRoCompat & EXT4_FEATURE_RO_COMP= AT_METADATA_CSUM) !=3D 0) {
> +=C2=A0 if (EXT4_HAS_METADATA_CSUM (Partition)) {
>=C2=A0 =C2=A0 =C2=A0return Ext4CalculateBlockGroupDescChecksumMetadataC= sum (Partition, BlockGroupDesc, BlockGroupNum);
> -=C2=A0 } else if ((Partition->FeaturesRoCompat & EXT4_FEATURE_= RO_COMPAT_GDT_CSUM) !=3D 0) {
> +=C2=A0 } else if (EXT4_HAS_GDT_CSUM (Partition)) {
>=C2=A0 =C2=A0 =C2=A0return Ext4CalculateBlockGroupDescChecksumGdtCsum (= Partition, BlockGroupDesc, BlockGroupNum);
>=C2=A0 =C2=A0}
>
> diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h b/Features/Ext4Pkg/Ext= 4Dxe/Ext4Dxe.h
> index b446488b2112..81e59a4babc9 100644
> --- a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h
> +++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h
> @@ -1095,7 +1095,7 @@ Ext4CalculateBlockGroupDescChecksum (
>=C2=A0 =C2=A0 @return TRUE if the gdt_csum is supported, else FALSE. > **/
> #define EXT4_HAS_GDT_CSUM(Partition)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\
> -=C2=A0 EXT4_HAS_RO_COMPAT(Partition, EXT4_FEATURE_RO_COMPAT_METADATA_= CSUM)
> +=C2=A0 EXT4_HAS_RO_COMPAT(Partition, EXT4_FEATURE_RO_COMPAT_GDT_CSUM)=
>
> /**
>=C2=A0 =C2=A0 Retrieves the volume name.
> --
> 2.37.3
>



--
Pedro Falcato
--00000000000001364c05e7f5ba32--