aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/backref.h
diff options
context:
space:
mode:
authorDavid Sterba <[email protected]>2025-04-22 15:55:41 +0000
committerDavid Sterba <[email protected]>2025-05-15 12:30:48 +0000
commit05a6ec865d091fe8244657df8063f74e704d1711 (patch)
tree4522b724dbec7392ae63f10db8f2eb89dc156b7d /fs/btrfs/backref.h
parentbtrfs: remove unused btrfs_io_stripe::length (diff)
downloadkernel-05a6ec865d091fe8244657df8063f74e704d1711.tar.gz
kernel-05a6ec865d091fe8244657df8063f74e704d1711.zip
btrfs: use unsigned types for constants defined as bit shifts
The unsigned type is a recommended practice (CWE-190, CWE-194) for bit shifts to avoid problems with potential unwanted sign extensions. Although there are no such cases in btrfs codebase, follow the recommendation. Reviewed-by: Boris Burkov <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/backref.h')
-rw-r--r--fs/btrfs/backref.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/backref.h b/fs/btrfs/backref.h
index 74e614031274..953637115956 100644
--- a/fs/btrfs/backref.h
+++ b/fs/btrfs/backref.h
@@ -423,8 +423,8 @@ struct btrfs_backref_node *btrfs_backref_alloc_node(
struct btrfs_backref_edge *btrfs_backref_alloc_edge(
struct btrfs_backref_cache *cache);
-#define LINK_LOWER (1 << 0)
-#define LINK_UPPER (1 << 1)
+#define LINK_LOWER (1U << 0)
+#define LINK_UPPER (1U << 1)
void btrfs_backref_link_edge(struct btrfs_backref_edge *edge,
struct btrfs_backref_node *lower,