mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
lib min_heap: use size_t for array size and index variables
Replace the int type with size_t for variables representing array sizes and indices in the min-heap implementation. Using size_t aligns with standard practices for size-related variables and avoids potential issues on platforms where int may be insufficient to represent all valid sizes or indices. Link: https://lkml.kernel.org/r/20250215165618.1757219-1-visitorckw@gmail.com Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com> Cc: Ching-Chun (Jim) Huang <jserv@ccns.ncku.edu.tw> Cc: Yu-Chun Lin <eleanor15x@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
5e40d0d196
commit
0ac451ecec
@@ -2,7 +2,7 @@
|
||||
#include <linux/export.h>
|
||||
#include <linux/min_heap.h>
|
||||
|
||||
void __min_heap_init(min_heap_char *heap, void *data, int size)
|
||||
void __min_heap_init(min_heap_char *heap, void *data, size_t size)
|
||||
{
|
||||
__min_heap_init_inline(heap, data, size);
|
||||
}
|
||||
@@ -20,7 +20,7 @@ bool __min_heap_full(min_heap_char *heap)
|
||||
}
|
||||
EXPORT_SYMBOL(__min_heap_full);
|
||||
|
||||
void __min_heap_sift_down(min_heap_char *heap, int pos, size_t elem_size,
|
||||
void __min_heap_sift_down(min_heap_char *heap, size_t pos, size_t elem_size,
|
||||
const struct min_heap_callbacks *func, void *args)
|
||||
{
|
||||
__min_heap_sift_down_inline(heap, pos, elem_size, func, args);
|
||||
|
||||
Reference in New Issue
Block a user