btrfs: make 1-bit bit-fields unsigned int
Subsystems (2)
PATCH 1/1 btrfs: make 1-bit bit-fields unsigned int
The bitfields have_csum and io_error are currently signed which is not recommended as the representation is an implementation defined behaviour. Fix this by making the bit-fields unsigned ints.
--- fs/btrfs/scrub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/scrub.c +2 -2
@@ -73,8 +73,8 @@ struct scrub_page {u64 physical_for_dev_replace;atomic_t refs;u8 mirror_num; - int have_csum:1; - int io_error:1; + unsigned int have_csum:1; + unsigned int io_error:1;u8 csum[BTRFS_CSUM_SIZE ];struct scrub_recover *recover;
Signature · 1 line
2.32.0
Quoted 6 lines · Colin Ian King
The bitfields
have_csumandio_errorare currently signed which is not recommended as the representation is an implementation defined behaviour. Fix this by making the bit-fields unsigned ints.Fixes 2c36395430b0 ("btrfs: scrub: remove the anonymous structure from scrub_page")Signed-off-by Colin Ian King <[email protected]>
Thanks,
Josef
Quoted 6 lines · Colin Ian King
The bitfields
have_csumandio_errorare currently signed which is not recommended as the representation is an implementation defined behaviour. Fix this by making the bit-fields unsigned ints.Fixes 2c36395430b0 ("btrfs: scrub: remove the anonymous structure from scrub_page")Signed-off-by Colin Ian King <[email protected]>
Thanks,
Qu
Quoted 20 lines
--- fs/btrfs/scrub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/btrfs/scrub.c +2
-2@@ -73,8 +73,8 @@ struct scrub_page {u64 physical_for_dev_replace;atomic_t refs;u8 mirror_num; - int have_csum:1; - int io_error:1; + unsigned int have_csum:1; + unsigned int io_error:1;u8 csum[BTRFS_CSUM_SIZE ];struct scrub_recover *recover;
Quoted 6 lines · Colin Ian King
The bitfields
have_csumandio_errorare currently signed which is not recommended as the representation is an implementation defined behaviour. Fix this by making the bit-fields unsigned ints.Fixes 2c36395430b0 ("btrfs: scrub: remove the anonymous structure from scrub_page")Signed-off-by Colin Ian King <[email protected]>
Added to misc-next, thanks.