public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Pedro Falcato" <pedro.falcato@gmail.com>
To: devel@edk2.groups.io
Cc: "Pedro Falcato" <pedro.falcato@gmail.com>,
	"Marvin Häuser" <mhaeuser@posteo.de>
Subject: [PATCH 1/1] Ext4Pkg: Fix bug in EXT4_HAS_GDT_CSUM
Date: Mon,  5 Sep 2022 02:58:23 +0100	[thread overview]
Message-ID: <20220905015823.33518-1-pedro.falcato@gmail.com> (raw)

Catched when running clang-tidy on this code. Also tidies up some logic
in BlockGroup.c

Cc: Marvin Häuser <mhaeuser@posteo.de>
Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
---
 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) != 0) {
+  if (EXT4_HAS_METADATA_CSUM (Partition)) {
     return Ext4CalculateBlockGroupDescChecksumMetadataCsum (Partition, BlockGroupDesc, BlockGroupNum);
-  } else if ((Partition->FeaturesRoCompat & EXT4_FEATURE_RO_COMPAT_GDT_CSUM) != 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


             reply	other threads:[~2022-09-05  1:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05  1:58 Pedro Falcato [this message]
2022-09-05  6:19 ` [PATCH 1/1] Ext4Pkg: Fix bug in EXT4_HAS_GDT_CSUM Marvin Häuser
2022-09-05 22:37   ` Pedro Falcato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220905015823.33518-1-pedro.falcato@gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox