diff mbox series

[08/21] bcachefs: eytzinger[01]_test improvement

Message ID 20250128163859.1883260-9-agruenba@redhat.com
State New
Headers show
Series bcachefs: eytzinger code | expand

Commit Message

Andreas Gruenbacher Jan. 28, 2025, 4:38 p.m. UTC
In eytzinger[01]_test(), make sure that eytzinger[01]_for_each()
iterates over all array elements.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 fs/bcachefs/util.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c
index 0ffbd22d3a5e..4122012ddfb2 100644
--- a/fs/bcachefs/util.c
+++ b/fs/bcachefs/util.c
@@ -728,6 +728,7 @@  void eytzinger1_test(void)
 
 			inorder++;
 		}
+		BUG_ON(inorder - 1 != size);
 	}
 }
 
@@ -761,6 +762,7 @@  void eytzinger0_test(void)
 
 			inorder++;
 		}
+		BUG_ON(inorder != size);
 	}
 }