Skip to content

Commit c9ebef4

Browse files
committed
btrfs-progs: use unsigned type for bit shift values
Bit shifts should be done on unsigned types, do that in remaining code. Signed-off-by: David Sterba <dsterba@suse.com>
1 parent c9d04fa commit c9ebef4

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

cmds/balance.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ static int do_balance_v1(int fd)
291291
}
292292

293293
enum {
294-
BALANCE_START_FILTERS = 1 << 0,
295-
BALANCE_START_NOWARN = 1 << 1
294+
BALANCE_START_FILTERS = 1U << 0,
295+
BALANCE_START_NOWARN = 1U << 1
296296
};
297297

298298
static int do_balance(const char *path, struct btrfs_ioctl_balance_args *args,

cmds/commands.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
#define __BTRFS_COMMANDS_H__
1919

2020
enum {
21-
CMD_HIDDEN = (1 << 0), /* should not be in help listings */
22-
CMD_ALIAS = (1 << 1), /* alias of next command in cmd_group */
23-
CMD_FORMAT_TEXT = (1 << 2), /* output as plain text */
24-
CMD_FORMAT_JSON = (1 << 3), /* output in json */
25-
CMD_DRY_RUN = (1 << 4), /* Accepts global --dry-run option. */
21+
CMD_HIDDEN = (1U << 0), /* should not be in help listings */
22+
CMD_ALIAS = (1U << 1), /* alias of next command in cmd_group */
23+
CMD_FORMAT_TEXT = (1U << 2), /* output as plain text */
24+
CMD_FORMAT_JSON = (1U << 3), /* output in json */
25+
CMD_DRY_RUN = (1U << 4), /* Accepts global --dry-run option. */
2626
};
2727

2828
#define CMD_FORMAT_MASK (CMD_FORMAT_TEXT | CMD_FORMAT_JSON)

cmds/props.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
#define __BTRFS_PROPS_H__
1919

2020
enum prop_object_type {
21-
prop_object_dev = (1 << 0),
22-
prop_object_root = (1 << 1),
23-
prop_object_subvol = (1 << 2),
24-
prop_object_inode = (1 << 3),
21+
prop_object_dev = (1U << 0),
22+
prop_object_root = (1U << 1),
23+
prop_object_subvol = (1U << 2),
24+
prop_object_inode = (1U << 3),
2525
__prop_object_max,
2626
};
2727

0 commit comments

Comments
 (0)