Skip to content

Commit ed9339b

Browse files
committed
btrfs-progs: image: convert int to bool in a few helpers
Signed-off-by: David Sterba <dsterba@suse.com>
1 parent d8172c2 commit ed9339b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

image/main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,20 +176,20 @@ static void csum_block(u8 *buf, size_t len)
176176
memcpy(buf, result, csum_size);
177177
}
178178

179-
static int has_name(struct btrfs_key *key)
179+
static bool has_name(struct btrfs_key *key)
180180
{
181181
switch (key->type) {
182182
case BTRFS_DIR_ITEM_KEY:
183183
case BTRFS_DIR_INDEX_KEY:
184184
case BTRFS_INODE_REF_KEY:
185185
case BTRFS_INODE_EXTREF_KEY:
186186
case BTRFS_XATTR_ITEM_KEY:
187-
return 1;
187+
return true;
188188
default:
189189
break;
190190
}
191191

192-
return 0;
192+
return false;
193193
}
194194

195195
static int chunk_cmp(struct rb_node *a, struct rb_node *b, int fuzz)
@@ -2350,7 +2350,7 @@ static int build_chunk_tree(struct mdrestore_struct *mdres,
23502350
return search_for_chunk_blocks(mdres);
23512351
}
23522352

2353-
static int range_contains_super(u64 physical, u64 bytes)
2353+
static bool range_contains_super(u64 physical, u64 bytes)
23542354
{
23552355
u64 super_bytenr;
23562356
int i;
@@ -2359,10 +2359,10 @@ static int range_contains_super(u64 physical, u64 bytes)
23592359
super_bytenr = btrfs_sb_offset(i);
23602360
if (super_bytenr >= physical &&
23612361
super_bytenr < physical + bytes)
2362-
return 1;
2362+
return true;
23632363
}
23642364

2365-
return 0;
2365+
return false;
23662366
}
23672367

23682368
static void remap_overlapping_chunks(struct mdrestore_struct *mdres)

image/sanitize.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,17 @@ static void find_collision_calc_suffix(unsigned long current_crc,
122122
/*
123123
* Check if suffix is valid according to our file name conventions
124124
*/
125-
static int find_collision_is_suffix_valid(const char *suffix)
125+
static bool find_collision_is_suffix_valid(const char *suffix)
126126
{
127127
int i;
128128
char c;
129129

130130
for (i = 0; i < 4; i++) {
131131
c = suffix[i];
132132
if (c < ' ' || c > 126 || c == '/')
133-
return 0;
133+
return false;
134134
}
135-
return 1;
135+
return true;
136136
}
137137

138138
static int find_collision_reverse_crc32c(struct name *val, u32 name_len)

0 commit comments

Comments
 (0)