]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
lib min_heap: Switch to size_t
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 7 Dec 2024 00:16:02 +0000 (19:16 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 21 Dec 2024 06:36:22 +0000 (01:36 -0500)
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 <visitorckw@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Coly Li <colyli@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
include/linux/min_heap.h

index e781727c891619e543329f74491e3583a4af08af..6325f6ffb895e6626b5cccae2079e4544e2a44eb 100644 (file)
@@ -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];        \
 }