diff options
| author | David Sterba <[email protected]> | 2025-04-22 15:55:41 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2025-05-15 12:30:48 +0000 |
| commit | 05a6ec865d091fe8244657df8063f74e704d1711 (patch) | |
| tree | 4522b724dbec7392ae63f10db8f2eb89dc156b7d /fs/btrfs/direct-io.c | |
| parent | btrfs: remove unused btrfs_io_stripe::length (diff) | |
| download | kernel-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/direct-io.c')
| -rw-r--r-- | fs/btrfs/direct-io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/direct-io.c b/fs/btrfs/direct-io.c index 3a03142dee09..fde612d9b077 100644 --- a/fs/btrfs/direct-io.c +++ b/fs/btrfs/direct-io.c @@ -151,8 +151,8 @@ static struct extent_map *btrfs_create_dio_extent(struct btrfs_inode *inode, } ordered = btrfs_alloc_ordered_extent(inode, start, file_extent, - (1 << type) | - (1 << BTRFS_ORDERED_DIRECT)); + (1U << type) | + (1U << BTRFS_ORDERED_DIRECT)); if (IS_ERR(ordered)) { if (em) { btrfs_free_extent_map(em); |
