From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx.groups.io with SMTP id smtpd.web08.20122.1662343121611035930 for ; Sun, 04 Sep 2022 18:58:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Xdjtv2oQ; spf=pass (domain: gmail.com, ip: 209.85.128.44, mailfrom: pedro.falcato@gmail.com) Received: by mail-wm1-f44.google.com with SMTP id az24-20020a05600c601800b003a842e4983cso4907146wmb.0 for ; Sun, 04 Sep 2022 18:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=PALImioHf/nqoZS6OFu4rTwk/LZBuQBPneBamLmsmFo=; b=Xdjtv2oQEtEfF+i7B+mvnYIGe2/mf21UmpgoZU+UrZv1PkrcMSa/Vml++Jwabt5V1M 23oOvaSmVQzuLMsCMq00W9+KeNxNowBZytY+0HS7Nmpc76d4Os7b9SYJIt/1TfJkcuMP relylAvHuS/DCLi2AzkpivvFcQETPTAxw6lVmTwK9Unob/GNJsGSJO2AqQlGPsXqO5yJ 8FotiaIjYVuaBkokXBvbzzwrxVRHMylEpG2I1y2gjpPJGv8N0fz/SHn6DL4oHl2wN4kg Sd8MooSuPm0OMn13WRZEolGdWH+TWFs9fO+YA+idc6HTnVmvzsid3VvHgyLvQ/dTi6uB 5GhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=PALImioHf/nqoZS6OFu4rTwk/LZBuQBPneBamLmsmFo=; b=dTIxCs9Sy3p8KGSJWxRgyoawJjmShyRAIMOaGot4eL/yNYxG9auEVrBQN3nzQOiJr0 0gLjaS4/cr96Cbnsne5CW5vOUUvbrGzhznHfbZgJNpMamI2uZS78xBwx62j+5sTTJCLK sHmIqGm2KvHNTHPWAJFP12dD6HaNEmcFlRbYqSnJCDQ3e3AVrmk5Mxv6zdjvY3F3a/4I lovZDNoMOzmLSoi7gHvGZdS5EnArMmSSVVb85VF6tESDmSD0kTC/OE9/ku6TITpp0cAl YfYkUZ55rxiF1+USoueigyJKBXaPPlyl7bYvXvDgglh0xFa+tYZbKU6ML6+2rrrOsNQB vn1w== X-Gm-Message-State: ACgBeo3Wtm14cvri1OgRXjwn6YaM/wpXZSrvF3qKMeEdy1g9KQRk5hg5 EzP0bcqsK6h4bbmxsiIF9/IEVpffztBtTQ== X-Google-Smtp-Source: AA6agR7Ff43oNLVSkRgII+OK91ukS05NMobKWx+X5FscS893xp7HPZQwSF+ikipw4xVLdWmjWQ0DlA== X-Received: by 2002:a05:600c:4fd4:b0:3a6:2694:e3bc with SMTP id o20-20020a05600c4fd400b003a62694e3bcmr9026147wmq.60.1662343119302; Sun, 04 Sep 2022 18:58:39 -0700 (PDT) Return-Path: Received: from PC-PEDRO-ARCH.lan ([2001:8a0:7280:5801:9441:3dce:686c:bfc7]) by smtp.gmail.com with ESMTPSA id p17-20020a5d4e11000000b00225250f2d1bsm7231559wrt.94.2022.09.04.18.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 18:58:38 -0700 (PDT) From: "Pedro Falcato" To: devel@edk2.groups.io Cc: Pedro Falcato , =?UTF-8?q?Marvin=20H=C3=A4user?= Subject: [PATCH 1/1] Ext4Pkg: Fix bug in EXT4_HAS_GDT_CSUM Date: Mon, 5 Sep 2022 02:58:23 +0100 Message-Id: <20220905015823.33518-1-pedro.falcato@gmail.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Catched when running clang-tidy on this code. Also tidies up some logic in BlockGroup.c Cc: Marvin Häuser 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) != 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