]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: xfs: clean up call to ul_crc32_exclude_offset
authorThomas Weißschuh <thomas@t-8ch.de>
Mon, 17 Apr 2023 09:38:26 +0000 (11:38 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Mon, 17 Apr 2023 09:38:46 +0000 (11:38 +0200)
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
libblkid/src/superblocks/xfs.c

index 6ab47ef1e4ccf36596d7b3b7430df42025f11b7a..f0e099e57e9b8cb5dd9fa72e7d591b4eaa136a80 100644 (file)
@@ -207,7 +207,6 @@ static int xfs_verify_sb(struct xfs_super_block *ondisk, blkid_probe pr,
        if ((sbp->sb_versionnum & 0x0f) == 5) {
                uint32_t expected, crc;
                unsigned char *csummed;
-               int crc_offset = offsetof(struct xfs_super_block, sb_crc);
 
                if (!(sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT))
                        return 0;
@@ -220,7 +219,8 @@ static int xfs_verify_sb(struct xfs_super_block *ondisk, blkid_probe pr,
                        return 0;
 
                crc = ul_crc32c_exclude_offset(~0LL, csummed, sbp->sb_sectsize,
-                                              crc_offset, sizeof(sbp->sb_crc));
+                                              offsetof(struct xfs_super_block, sb_crc),
+                                              sizeof_member(struct xfs_super_block, sb_crc));
                crc = bswap_32(crc ^ ~0LL);
 
                if (!blkid_probe_verify_csum(pr, crc, expected))