Commit 9c894696 authored by Dan Carpenter's avatar Dan Carpenter Committed by David Sterba

Btrfs: remove some no-op casts

We cast 0 to a u8 but then because of type promotion, it's immediately
cast to int back to int before we do a bitwise negate.  The cast doesn't
matter in this case, the code works as intended.  It causes a static
checker warning though so let's remove it.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent dd4b857a
...@@ -5569,7 +5569,7 @@ void le_bitmap_set(u8 *map, unsigned int start, int len) ...@@ -5569,7 +5569,7 @@ void le_bitmap_set(u8 *map, unsigned int start, int len)
*p |= mask_to_set; *p |= mask_to_set;
len -= bits_to_set; len -= bits_to_set;
bits_to_set = BITS_PER_BYTE; bits_to_set = BITS_PER_BYTE;
mask_to_set = ~(u8)0; mask_to_set = ~0;
p++; p++;
} }
if (len) { if (len) {
...@@ -5589,7 +5589,7 @@ void le_bitmap_clear(u8 *map, unsigned int start, int len) ...@@ -5589,7 +5589,7 @@ void le_bitmap_clear(u8 *map, unsigned int start, int len)
*p &= ~mask_to_clear; *p &= ~mask_to_clear;
len -= bits_to_clear; len -= bits_to_clear;
bits_to_clear = BITS_PER_BYTE; bits_to_clear = BITS_PER_BYTE;
mask_to_clear = ~(u8)0; mask_to_clear = ~0;
p++; p++;
} }
if (len) { if (len) {
...@@ -5679,7 +5679,7 @@ void extent_buffer_bitmap_set(struct extent_buffer *eb, unsigned long start, ...@@ -5679,7 +5679,7 @@ void extent_buffer_bitmap_set(struct extent_buffer *eb, unsigned long start,
kaddr[offset] |= mask_to_set; kaddr[offset] |= mask_to_set;
len -= bits_to_set; len -= bits_to_set;
bits_to_set = BITS_PER_BYTE; bits_to_set = BITS_PER_BYTE;
mask_to_set = ~(u8)0; mask_to_set = ~0;
if (++offset >= PAGE_SIZE && len > 0) { if (++offset >= PAGE_SIZE && len > 0) {
offset = 0; offset = 0;
page = eb->pages[++i]; page = eb->pages[++i];
...@@ -5721,7 +5721,7 @@ void extent_buffer_bitmap_clear(struct extent_buffer *eb, unsigned long start, ...@@ -5721,7 +5721,7 @@ void extent_buffer_bitmap_clear(struct extent_buffer *eb, unsigned long start,
kaddr[offset] &= ~mask_to_clear; kaddr[offset] &= ~mask_to_clear;
len -= bits_to_clear; len -= bits_to_clear;
bits_to_clear = BITS_PER_BYTE; bits_to_clear = BITS_PER_BYTE;
mask_to_clear = ~(u8)0; mask_to_clear = ~0;
if (++offset >= PAGE_SIZE && len > 0) { if (++offset >= PAGE_SIZE && len > 0) {
offset = 0; offset = 0;
page = eb->pages[++i]; page = eb->pages[++i];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment