Btrfs: avoid build warning on 32-bit
PATCH 1/1 Btrfs: avoid build warning on 32-bit
A recent change introduced a type cast from a private 64-bit value to a pointer, which works fine on 64-bit architectures, but not on 32-bit ones, where it produces a harmless compiler warning:
fs/btrfs/extent_io.c: In function 'btrfs_free_io_failure_record':fs/btrfs/extent_io.c:2193:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
This adds an intermediate cast to 'unsigned long', which tells the compiler to ignore the type mismatch.
or when the inode is freeing")
fs/btrfs/extent_io.c +1 -1
@@ -2190,7 +2190,7 @@ void btrfs_free_io_failure_record(struct inode *inode, u64 start, u64 end) next =next_state (state); - failrec = (struct io_failure_record *)state->private; + failrec = (struct io_failure_record *)(unsigned long )state->private;free_extent_state (state);kfree (failrec);
Quoted 8 lines · Arnd Bergmann
A recent change introduced a type cast from a private 64-bit value to a pointer, which works fine on 64-bit architectures, but not on 32-bit ones, where it produces a harmless compiler warning:
fs/btrfs/extent_io.c: In function 'btrfs_free_io_failure_record':fs/btrfs/extent_io.c:2193:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Quoted 6 lines
This adds an intermediate cast to 'unsigned long', which tells the compiler to ignore the type mismatch.
Signed-off-by Arnd Bergmann <[email protected]>Fixes f612496bca664 ("Btrfs: cleanup the read failure record after writeor when the inode is freeing")
Already reported, but not merged
Quoted 13 lines · David Sterba
Quoted 12 lines · Arnd Bergmann
A recent change introduced a type cast from a private 64-bit value to a pointer, which works fine on 64-bit architectures, but not on 32-bit ones, where it produces a harmless compiler warning:
fs/btrfs/extent_io.c: In function 'btrfs_free_io_failure_record':
fs/btrfs/extent_io.c:2193:13: warning: cast to pointer from integer
of different size [-Wint-to-pointer-cast]This adds an intermediate cast to 'unsigned long', which tells the compiler to ignore the type mismatch.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Arnd Bergmann <[email protected]>Fixes f612496bca664 ("Btrfs: cleanup the read failure record afterwrite
or when the inode is freeing")Already reported, but not merged
I'll take the original cast one for now and we can do the larger cleanup for the next merge window.
-chris