btrfs-progs: use unsigned types for bit shifts in configure.ac and docs

Bit shifts should be done on unsigned type as a matter of good practice
to avoid any problems with bit overflowing to the sign bit.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2024-03-12 22:03:36 +01:00
parent ca68bab8ab
commit 76c49eb686
2 changed files with 4 additions and 4 deletions

View file

@ -155,11 +155,11 @@ DATA STRUCTURES AND DEFINITIONS
.. code-block:: c
/* Request information about checksum type and size */
#define BTRFS_FS_INFO_FLAG_CSUM_INFO (1 << 0)
#define BTRFS_FS_INFO_FLAG_CSUM_INFO (1U << 0)
/* Request information about filesystem generation */
#define BTRFS_FS_INFO_FLAG_GENERATION (1 << 1)
#define BTRFS_FS_INFO_FLAG_GENERATION (1U << 1)
/* Request information about filesystem metadata UUID */
#define BTRFS_FS_INFO_FLAG_METADATA_UUID (1 << 2)
#define BTRFS_FS_INFO_FLAG_METADATA_UUID (1U << 2)
struct btrfs_ioctl_fs_info_args {
__u64 max_id; /* out */

View file

@ -310,7 +310,7 @@ AS_IF([test "x$have_ext4_epoch_mask_define" = xno], [
[
AC_DEFINE([HAVE_EXT4_EPOCH_MASK_DEFINE], [1], [Define to 1 if ext2_inode_large includes i_atime_extra])
AC_DEFINE([EXT4_EPOCH_BITS], [2],[for encode and decode tv_nsec in ext2 inode])
AC_DEFINE([EXT4_EPOCH_MASK], [((1 << EXT4_EPOCH_BITS) - 1)], [For encode and decode tv_nsec info in ext2 inode])
AC_DEFINE([EXT4_EPOCH_MASK], [((1U << EXT4_EPOCH_BITS) - 1)], [For encode and decode tv_nsec info in ext2 inode])
AC_DEFINE([EXT4_NSEC_MASK], [(~0UL << EXT4_EPOCH_BITS)], [For encode and decode tv_nsec info in ext2 inode])
AC_DEFINE([inode_includes(size, field)],[m4_normalize[(size >= (sizeof(((struct ext2_inode_large *)0)->field) + offsetof(struct ext2_inode_large, field)))]],
[For encode and decode tv_nsec info in ext2 inode])