]> Gentwo Git Trees - linux/.git/commit
lib min_heap: use size_t for array size and index variables
authorKuan-Wei Chiu <visitorckw@gmail.com>
Sat, 15 Feb 2025 16:56:18 +0000 (00:56 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 23 Feb 2025 06:26:19 +0000 (22:26 -0800)
commita30546a0ed94eaabda1a58102f055de826b21a7a
treec0a6248c18cb7b77b0e1198c229128a293528389
parent510f7e9dc4b0c02367b3dfeb3193a2ce9dd838f7
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>
include/linux/min_heap.h
lib/min_heap.c