From 0587df6b11afb80a767cc106463e772e7f7c82fa Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 6 Dec 2024 19:16:02 -0500 Subject: [PATCH 179/213] lib min_heap: Switch to size_t Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit size_t is the correct type for a count of objects that can fit in memory: this also means heaps now have the same memory layout as darrays (fs/bcachefs/darray.h), and darrays can be used as heaps. Cc: Kuan-Wei Chiu Cc: Ian Rogers Cc: Andrew Morton Cc: Coly Li Cc: Peter Zijlstra Signed-off-by: Kent Overstreet Signed-off-by: Alexander Miroshnichenko --- include/linux/min_heap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/min_heap.h b/include/linux/min_heap.h index 43a7b9dcf15e..fe17b4828171 100644 --- a/include/linux/min_heap.h +++ b/include/linux/min_heap.h @@ -15,8 +15,8 @@ */ #define MIN_HEAP_PREALLOCATED(_type, _name, _nr) \ struct _name { \ - int nr; \ - int size; \ + size_t nr; \ + size_t size; \ _type *data; \ _type preallocated[_nr]; \ } -- 2.45.2