From: Kent Overstreet Date: Sat, 7 Dec 2024 00:16:02 +0000 (-0500) Subject: lib min_heap: Switch to size_t X-Git-Tag: v6.14-rc1~204^2~89 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dec6c0aac4fc;p=thirdparty%2Fkernel%2Flinux.git lib min_heap: Switch to size_t 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 --- diff --git a/include/linux/min_heap.h b/include/linux/min_heap.h index e781727c89161..6325f6ffb895e 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]; \ }