diff mbox series

btrfs-progs: unbreak btrfs-sb-mod compilation

Message ID 20191010140949.6590-1-jthumshirn@suse.de (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: unbreak btrfs-sb-mod compilation | expand

Commit Message

Johannes Thumshirn Oct. 10, 2019, 2:09 p.m. UTC
Fix compiler warnings and errors in btrfs-sb-mod due to incorrect
conversion with the checksum updates.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 btrfs-sb-mod.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

David Sterba Oct. 10, 2019, 5:02 p.m. UTC | #1
On Thu, Oct 10, 2019 at 04:09:49PM +0200, Johannes Thumshirn wrote:
> Fix compiler warnings and errors in btrfs-sb-mod due to incorrect
> conversion with the checksum updates.
> 
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---

Applied, thnanks.
diff mbox series

Patch

diff --git a/btrfs-sb-mod.c b/btrfs-sb-mod.c
index 348991b39451..ad143ca05aa6 100644
--- a/btrfs-sb-mod.c
+++ b/btrfs-sb-mod.c
@@ -36,7 +36,7 @@  static int check_csum_superblock(void *sb)
 	u8 result[BTRFS_CSUM_SIZE];
 	u16 csum_type = btrfs_super_csum_type(sb);
 
-	btrfs_csum_data(csum_type, (char *)sb + BTRFS_CSUM_SIZE,
+	btrfs_csum_data(csum_type, (unsigned char *)sb + BTRFS_CSUM_SIZE,
 			result, BTRFS_SUPER_INFO_SIZE - BTRFS_CSUM_SIZE);
 
 	return !memcmp(sb, result, csum_size);
@@ -48,7 +48,7 @@  static void update_block_csum(void *block)
 	struct btrfs_header *hdr;
 	u16 csum_type = btrfs_super_csum_type(block);
 
-	btrfs_csum_data(csum_type, (char *)block + BTRFS_CSUM_SIZE,
+	btrfs_csum_data(csum_type, (unsigned char *)block + BTRFS_CSUM_SIZE,
 			result, BTRFS_SUPER_INFO_SIZE - BTRFS_CSUM_SIZE);
 
 	memset(block, 0, BTRFS_CSUM_SIZE);
@@ -283,7 +283,7 @@  int main(int argc, char **argv) {
 	}
 
 	/* verify superblock */
-	csum_size = btrfs_csum_sizes[BTRFS_CSUM_TYPE_CRC32];
+	csum_size = btrfs_csum_type_size(BTRFS_CSUM_TYPE_CRC32);
 	off = BTRFS_SUPER_INFO_OFFSET;
 
 	ret = pread(fd, buf, BLOCKSIZE, off);