From c9ebef41ec38e1b39f1f01ca76874719a057170c Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 24 Oct 2023 21:03:56 +0200 Subject: [PATCH] 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 --- cmds/balance.c | 4 ++-- cmds/commands.h | 10 +++++----- cmds/props.h | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmds/balance.c b/cmds/balance.c index c48133ad..2c703a59 100644 --- a/cmds/balance.c +++ b/cmds/balance.c @@ -291,8 +291,8 @@ static int do_balance_v1(int fd) } enum { - BALANCE_START_FILTERS = 1 << 0, - BALANCE_START_NOWARN = 1 << 1 + BALANCE_START_FILTERS = 1U << 0, + BALANCE_START_NOWARN = 1U << 1 }; static int do_balance(const char *path, struct btrfs_ioctl_balance_args *args, diff --git a/cmds/commands.h b/cmds/commands.h index 464f9017..c19e664a 100644 --- a/cmds/commands.h +++ b/cmds/commands.h @@ -18,11 +18,11 @@ #define __BTRFS_COMMANDS_H__ enum { - CMD_HIDDEN = (1 << 0), /* should not be in help listings */ - CMD_ALIAS = (1 << 1), /* alias of next command in cmd_group */ - CMD_FORMAT_TEXT = (1 << 2), /* output as plain text */ - CMD_FORMAT_JSON = (1 << 3), /* output in json */ - CMD_DRY_RUN = (1 << 4), /* Accepts global --dry-run option. */ + CMD_HIDDEN = (1U << 0), /* should not be in help listings */ + CMD_ALIAS = (1U << 1), /* alias of next command in cmd_group */ + CMD_FORMAT_TEXT = (1U << 2), /* output as plain text */ + CMD_FORMAT_JSON = (1U << 3), /* output in json */ + CMD_DRY_RUN = (1U << 4), /* Accepts global --dry-run option. */ }; #define CMD_FORMAT_MASK (CMD_FORMAT_TEXT | CMD_FORMAT_JSON) diff --git a/cmds/props.h b/cmds/props.h index 0f786b18..89696a81 100644 --- a/cmds/props.h +++ b/cmds/props.h @@ -18,10 +18,10 @@ #define __BTRFS_PROPS_H__ enum prop_object_type { - prop_object_dev = (1 << 0), - prop_object_root = (1 << 1), - prop_object_subvol = (1 << 2), - prop_object_inode = (1 << 3), + prop_object_dev = (1U << 0), + prop_object_root = (1U << 1), + prop_object_subvol = (1U << 2), + prop_object_inode = (1U << 3), __prop_object_max, };