diff mbox series

[2/2] dm vdo: use #define for NO_CHAPTER and NO_CHAPTER_INDEX_ENTRY

Message ID c87c66f1d8d056b5049ec8d0d15661be0b6d27c6.1707873765.git.msakai@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Mike Snitzer
Headers show
Series [1/2] dm vdo: move encoding constants to encodings.c | expand

Commit Message

Matthew Sakai Feb. 14, 2024, 1:24 a.m. UTC
From: Mike Snitzer <snitzer@kernel.org>

Avoids unconventional use of 'static const' and enum in headers.

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
---
 drivers/md/dm-vdo/chapter-index.h | 6 ++----
 drivers/md/dm-vdo/volume-index.h  | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/md/dm-vdo/chapter-index.h b/drivers/md/dm-vdo/chapter-index.h
index e1bc7e31a2a5..be8bf2b675b1 100644
--- a/drivers/md/dm-vdo/chapter-index.h
+++ b/drivers/md/dm-vdo/chapter-index.h
@@ -18,10 +18,8 @@ 
  * is more efficient. Both types of chapter index are implemented with a delta index.
  */
 
-enum {
-	/* The value returned when no entry is found in the chapter index. */
-	NO_CHAPTER_INDEX_ENTRY = U16_MAX,
-};
+/* The value returned when no entry is found in the chapter index. */
+#define NO_CHAPTER_INDEX_ENTRY U16_MAX
 
 struct open_chapter_index {
 	const struct index_geometry *geometry;
diff --git a/drivers/md/dm-vdo/volume-index.h b/drivers/md/dm-vdo/volume-index.h
index 0f08acf29435..537e9947cf4a 100644
--- a/drivers/md/dm-vdo/volume-index.h
+++ b/drivers/md/dm-vdo/volume-index.h
@@ -26,7 +26,7 @@ 
  * managed with volume_index_record structures.
  */
 
-static const u64 NO_CHAPTER = U64_MAX;
+#define NO_CHAPTER U64_MAX
 
 struct volume_index_stats {
 	/* Nanoseconds spent rebalancing */