Re: [PATCH 1/2] btrfs-progs: fix compile warning due to global fs_info cleanup

Josef Bacik
2020-08-26T14:27:04Z

On 8/25/20 8:47 PM, Qu Wenruo wrote:
> [BUG]
> Compiler gives the following warning:
>
> check/main.c: In function 'check_chunks_and_extents':
> check/main.c:8712:30: warning: assignment to 'int (*)(struct btrfs_fs_info *, u64, u64, u64, u64, u64, u64, int)' {aka 'int (*)(struct btrfs_fs_info *, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, int)'} from incompatible pointer type 'int (*)(u64, u64, u64, u64, u64, u64, int)' {aka 'int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, int)'} [-Wincompatible-pointer-types]
> 8712 | gfs_info->free_extent_hook = free_extent_hook;
>
> And obviously, this would screwup original mode repair.
>
> [CAUSE]
> Commit b91222b3 ("btrfs-progs: check: drop unused fs_info") removes the
> fs_info parameter for free_extent_hook(), but didn't remove the
> parameter for the definition.
>
> [FIX]
> Also remove the fs_info parameter for the hook definition.
>
> Fixes: b91222b3 ("btrfs-progs: check: drop unused fs_info")
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef