]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nilfs2: use the BITS_PER_LONG macro
authorRyusuke Konishi <konishi.ryusuke@gmail.com>
Mon, 26 Aug 2024 17:41:10 +0000 (02:41 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 2 Sep 2024 03:43:42 +0000 (20:43 -0700)
The macros NILFS_BMAP_KEY_BIT and NILFS_BMAP_NEW_PTR_INIT calculate,
within their definitions, the number of bits in an unsigned long variable.
Use the BITS_PER_LONG macro to make them simpler.

Link: https://lkml.kernel.org/r/20240826174116.5008-3-konishi.ryusuke@gmail.com
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: Huang Xiaojia <huangxiaojia2@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/nilfs2/bmap.h

index 5f8c8c5526208b12df98ccd5f9d522102829d5f2..4656df3927228e0c5188bf1f5a5787a392e4a2f3 100644 (file)
@@ -87,9 +87,8 @@ struct nilfs_bmap_operations {
 
 
 #define NILFS_BMAP_SIZE                (NILFS_INODE_BMAP_SIZE * sizeof(__le64))
-#define NILFS_BMAP_KEY_BIT     (sizeof(unsigned long) * 8 /* CHAR_BIT */)
-#define NILFS_BMAP_NEW_PTR_INIT        \
-       (1UL << (sizeof(unsigned long) * 8 /* CHAR_BIT */ - 1))
+#define NILFS_BMAP_KEY_BIT     BITS_PER_LONG
+#define NILFS_BMAP_NEW_PTR_INIT        (1UL << (BITS_PER_LONG - 1))
 
 static inline int nilfs_bmap_is_new_ptr(unsigned long ptr)
 {