Linux NILFS development
 help / color / mirror / Atom feed
From: Ryusuke Konishi <konishi.ryusuke@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-nilfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/8] nilfs2: use the BITS_PER_LONG macro
Date: Tue, 27 Aug 2024 02:41:10 +0900	[thread overview]
Message-ID: <20240826174116.5008-3-konishi.ryusuke@gmail.com> (raw)
In-Reply-To: <20240826174116.5008-1-konishi.ryusuke@gmail.com>

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.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
---
 fs/nilfs2/bmap.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/nilfs2/bmap.h b/fs/nilfs2/bmap.h
index 5f8c8c552620..4656df392722 100644
--- a/fs/nilfs2/bmap.h
+++ b/fs/nilfs2/bmap.h
@@ -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)
 {
-- 
2.34.1


  parent reply	other threads:[~2024-08-26 17:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-26 17:41 [PATCH 0/8] nilfs2: assorted cleanups Ryusuke Konishi
2024-08-26 17:41 ` [PATCH 1/8] nilfs2: use common implementation of file type Ryusuke Konishi
2024-08-26 17:41 ` Ryusuke Konishi [this message]
2024-08-26 17:41 ` [PATCH 3/8] nilfs2: separate inode type information from i_state field Ryusuke Konishi
2024-08-26 17:41 ` [PATCH 4/8] nilfs2: eliminate the shared counter and spinlock for i_generation Ryusuke Konishi
2024-08-26 17:41 ` [PATCH 5/8] nilfs2: do not repair reserved inode bitmap in nilfs_new_inode() Ryusuke Konishi
2024-08-26 17:41 ` [PATCH 6/8] nilfs2: remove sc_timer_task Ryusuke Konishi
2024-08-26 17:41 ` [PATCH 7/8] nilfs2: use kthread_create and kthread_stop for the log writer thread Ryusuke Konishi
2024-08-26 17:41 ` [PATCH 8/8] nilfs2: refactor nilfs_segctor_thread() Ryusuke Konishi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240826174116.5008-3-konishi.ryusuke@gmail.com \
    --to=konishi.ryusuke@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nilfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox