Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] btrfs-progs: unbreak btrfs-sb-mod compilation
@ 2019-10-10 14:09 Johannes Thumshirn
  2019-10-10 17:02 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Thumshirn @ 2019-10-10 14:09 UTC (permalink / raw)
  To: David Sterba; +Cc: Linux BTRFS Mailinglist, Johannes Thumshirn

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(-)

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);
-- 
2.16.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs-progs: unbreak btrfs-sb-mod compilation
  2019-10-10 14:09 [PATCH] btrfs-progs: unbreak btrfs-sb-mod compilation Johannes Thumshirn
@ 2019-10-10 17:02 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2019-10-10 17:02 UTC (permalink / raw)
  To: Johannes Thumshirn; +Cc: David Sterba, Linux BTRFS Mailinglist

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10 14:09 [PATCH] btrfs-progs: unbreak btrfs-sb-mod compilation Johannes Thumshirn
2019-10-10 17:02 ` David Sterba

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org linux-btrfs@archiver.kernel.org
	public-inbox-index linux-btrfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox