From nobody Fri Dec 27 00:25:22 2024 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12A4C1A0B13; Fri, 29 Nov 2024 18:12:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732903957; cv=none; b=jy0g8grycV3l+AwpMgfQsK+1OKrc2BeTtPA+hEBtkWUeL53YZhtKwAsNPyxDwYiS14xwGEzKQaHsbcKGstgJtJFCqQ2uzhpBxEZWcLMeycLuI4wruhuN3evPLJUMDgTyec7KPgBnbqCQxNiZBswNO+3/Revli50o58WXsmPwsNc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732903957; c=relaxed/simple; bh=hFqaZCuzLCN/kjh0t2Lm5R741ch19PL2+BxpRQEIaLw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DmmCwB62eJ2i5klbt+Q2Xe2f34pqOPNzHwVr8EvyjOssA6wSdrG8TsiEhYC9Y8aAhPV+sOpX+qJwVQWc2o8id3c1sV4Mo0DECTeGhLK8SgrjOSO4gaxQmGZO/7afXIek5UXIeQquD6wO8cvwiWlNTSUk89Run2P14da+rsKjtoM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kNdvwgpO; arc=none smtp.client-ip=209.85.216.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kNdvwgpO" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2e9e377aeadso1760553a91.1; Fri, 29 Nov 2024 10:12:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732903954; x=1733508754; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=a9SB3AMYPBQXj0bhHp6Yep5+PKQx14JSqL2FKuHdcys=; b=kNdvwgpOeozmh7ofVuoM1foWiGdrip8bSqj0Vudyc/26rSP5Ibj75P56gnCWbnBPSs IH5BXu7+yC7kjXUpu647lTSrDQDFDiyxknyOURSgn3B3u4PrZ1AvrXUyBxla/otK17A6 PlQa1foKnBq5TJgqkDStnUYnhOlxlTBhaYYYWu/eMmj1E9jYTMamqM8/8ASffFq2PNTL NirvTuXTv41BQHiAaKkWVA7ImcSu34w2uJcplPVPJV2SACErs/nN/cy/Mm32ol/gTfOt LdrdZpSdKtxFMnpiwtJLhqevcsmn6GqbaHQRRPXRoQTZu5PVGBPE3TnjFBHe6eJsw0+8 23pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732903954; x=1733508754; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a9SB3AMYPBQXj0bhHp6Yep5+PKQx14JSqL2FKuHdcys=; b=btj/mxzv0uWIlmra2VMCSY419k2UYqQWPrGfznUDPlG/chAA3dS4Obo4I0OKkpt1d/ c1znufiyXD1dL5tSSsp8IMVMUmBW22Rfz7fgT2qjS9dGM/UKsHqkiSy2HiwGO0sTZCC1 0sbHI+gMDDHstlUBuF/lpogbxTxiYydmuqv2fDJ7BR7+ec7ywHH2kDD2BrAWBUFXauVk 6RDTpgoHqlq96OFZLGn99hpDVG9dw1Cdh3JWoJ79KS7oICYKGvL4T3uySdqazVTik1aN zb+KFfk93rBAllwNFBajfkSugedg2LugfWGqalZV8oPfV8znY+MEzTgRtT5HnpGCiRbD 8ibQ== X-Forwarded-Encrypted: i=1; AJvYcCUD8gGpM2l4ZbpDLjTctT9j5dlHbIlMEGIjlTbwh3BPft2+yzoZdIeaMZPIV4AvhYpSLIT6pjTE99AxDNh+@vger.kernel.org, AJvYcCVfZk7wGNniu0632V0uJPon1Y3UYfRyIbYwtQD1C0yemlXZ4O8kW35dZY08Apolo7DM0XtI+nAaSDo=@vger.kernel.org X-Gm-Message-State: AOJu0Yzhmbus3TWicJniPcRK5gSRN+Q6utilK362h4jwlXj9jf+9Hl9s fqYs/YNU7qxAuanuJRmTsE1kNJr3N+IzhUtnomkhUHwKdTd7vSzB X-Gm-Gg: ASbGncuK/Z8/FJvUXIGtw1+XULMqgGRltOJ818VMf2S4Pmzzisb3zEJPdrQPB1X5/dS zd/vRN4niGKUZQrYK3iWhdSdJh/9v1gZ8qOj4jRQO2eafeUB64MltQcxleKn6wkUN/hd3hoflgk mkAdVARYzmKEN308Gtmn7pO+KNjP4rl0Prd9GP/yDyNg9tIYCc8wegYmXKjKcWgPXFjBlvL+48T fGOS+qVAFS8yyoMlcYNu65a7fYb3cpAt8R4rZ3F6p9ywakdqvjdzXE+2HqTt1rOMP3JLDD/w76T 0mqM X-Google-Smtp-Source: AGHT+IF9+ka++uUfxI6HLpg+2EhSqcfv9jDWHZ7yUXX1CkBbTaU+ULP5gNn47y3LwHnLdC75bYUmNg== X-Received: by 2002:a17:90b:4c4d:b0:2ea:6d98:b499 with SMTP id 98e67ed59e1d1-2ee097e5252mr13802967a91.36.1732903954196; Fri, 29 Nov 2024 10:12:34 -0800 (PST) Received: from visitorckw-System-Product-Name.. ([140.113.216.168]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72541761474sm3760595b3a.32.2024.11.29.10.12.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 10:12:33 -0800 (PST) From: Kuan-Wei Chiu To: akpm@linux-foundation.org, corbet@lwn.net Cc: geert@linux-m68k.org, jserv@ccns.ncku.edu.tw, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Kuan-Wei Chiu Subject: [PATCH 1/4] lib min_heap: Improve type safety in min_heap macros by using container_of Date: Sat, 30 Nov 2024 02:12:19 +0800 Message-Id: <20241129181222.646855-2-visitorckw@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241129181222.646855-1-visitorckw@gmail.com> References: <20241129181222.646855-1-visitorckw@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The current implementation of min_heap macros uses explicit casting to min_heap_char *, which prevents the compiler from detecting incorrect pointer types. This can lead to errors if non-min_heap pointers are passed inadvertently. To enhance safety, replace all explicit casts to min_heap_char * with the use of container_of(&(_heap)->nr, min_heap_char, nr). This approach ensures that the _heap parameter is indeed a min_heap_char-compatible structure, allowing the compiler to catch improper usages. Link: https://lore.kernel.org/lkml/CAMuHMdVO5DPuD9HYWBFqKDHphx7+0BEhreUxtVC= 40A=3D8p6VAhQ@mail.gmail.com Suggested-by: Geert Uytterhoeven Signed-off-by: Kuan-Wei Chiu --- include/linux/min_heap.h | 61 +++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/include/linux/min_heap.h b/include/linux/min_heap.h index e781727c8916..456cfbc1b8f5 100644 --- a/include/linux/min_heap.h +++ b/include/linux/min_heap.h @@ -218,7 +218,7 @@ void __min_heap_init_inline(min_heap_char *heap, void *= data, int size) } =20 #define min_heap_init_inline(_heap, _data, _size) \ - __min_heap_init_inline((min_heap_char *)_heap, _data, _size) + __min_heap_init_inline(container_of(&(_heap)->nr, min_heap_char, nr), _da= ta, _size) =20 /* Get the minimum element from the heap. */ static __always_inline @@ -228,7 +228,8 @@ void *__min_heap_peek_inline(struct min_heap_char *heap) } =20 #define min_heap_peek_inline(_heap) \ - (__minheap_cast(_heap) __min_heap_peek_inline((min_heap_char *)_heap)) + (__minheap_cast(_heap) \ + __min_heap_peek_inline(container_of(&(_heap)->nr, min_heap_char, nr))) =20 /* Check if the heap is full. */ static __always_inline @@ -238,7 +239,7 @@ bool __min_heap_full_inline(min_heap_char *heap) } =20 #define min_heap_full_inline(_heap) \ - __min_heap_full_inline((min_heap_char *)_heap) + __min_heap_full_inline(container_of(&(_heap)->nr, min_heap_char, nr)) =20 /* Sift the element at pos down the heap. */ static __always_inline @@ -277,8 +278,8 @@ void __min_heap_sift_down_inline(min_heap_char *heap, i= nt pos, size_t elem_size, } =20 #define min_heap_sift_down_inline(_heap, _pos, _func, _args) \ - __min_heap_sift_down_inline((min_heap_char *)_heap, _pos, __minheap_obj_s= ize(_heap), \ - _func, _args) + __min_heap_sift_down_inline(container_of(&(_heap)->nr, min_heap_char, nr)= , _pos, \ + __minheap_obj_size(_heap), _func, _args) =20 /* Sift up ith element from the heap, O(log2(nr)). */ static __always_inline @@ -304,8 +305,8 @@ void __min_heap_sift_up_inline(min_heap_char *heap, siz= e_t elem_size, size_t idx } =20 #define min_heap_sift_up_inline(_heap, _idx, _func, _args) \ - __min_heap_sift_up_inline((min_heap_char *)_heap, __minheap_obj_size(_hea= p), _idx, \ - _func, _args) + __min_heap_sift_up_inline(container_of(&(_heap)->nr, min_heap_char, nr), \ + __minheap_obj_size(_heap), _idx, _func, _args) =20 /* Floyd's approach to heapification that is O(nr). */ static __always_inline @@ -319,7 +320,8 @@ void __min_heapify_all_inline(min_heap_char *heap, size= _t elem_size, } =20 #define min_heapify_all_inline(_heap, _func, _args) \ - __min_heapify_all_inline((min_heap_char *)_heap, __minheap_obj_size(_heap= ), _func, _args) + __min_heapify_all_inline(container_of(&(_heap)->nr, min_heap_char, nr), \ + __minheap_obj_size(_heap), _func, _args) =20 /* Remove minimum element from the heap, O(log2(nr)). */ static __always_inline @@ -340,7 +342,8 @@ bool __min_heap_pop_inline(min_heap_char *heap, size_t = elem_size, } =20 #define min_heap_pop_inline(_heap, _func, _args) \ - __min_heap_pop_inline((min_heap_char *)_heap, __minheap_obj_size(_heap), = _func, _args) + __min_heap_pop_inline(container_of(&(_heap)->nr, min_heap_char, nr), \ + __minheap_obj_size(_heap), _func, _args) =20 /* * Remove the minimum element and then push the given element. The @@ -356,8 +359,8 @@ void __min_heap_pop_push_inline(min_heap_char *heap, co= nst void *element, size_t } =20 #define min_heap_pop_push_inline(_heap, _element, _func, _args) \ - __min_heap_pop_push_inline((min_heap_char *)_heap, _element, __minheap_ob= j_size(_heap), \ - _func, _args) + __min_heap_pop_push_inline(container_of(&(_heap)->nr, min_heap_char, nr),= _element, \ + __minheap_obj_size(_heap), _func, _args) =20 /* Push an element on to the heap, O(log2(nr)). */ static __always_inline @@ -382,8 +385,8 @@ bool __min_heap_push_inline(min_heap_char *heap, const = void *element, size_t ele } =20 #define min_heap_push_inline(_heap, _element, _func, _args) \ - __min_heap_push_inline((min_heap_char *)_heap, _element, __minheap_obj_si= ze(_heap), \ - _func, _args) + __min_heap_push_inline(container_of(&(_heap)->nr, min_heap_char, nr), _el= ement, \ + __minheap_obj_size(_heap), _func, _args) =20 /* Remove ith element from the heap, O(log2(nr)). */ static __always_inline @@ -411,8 +414,8 @@ bool __min_heap_del_inline(min_heap_char *heap, size_t = elem_size, size_t idx, } =20 #define min_heap_del_inline(_heap, _idx, _func, _args) \ - __min_heap_del_inline((min_heap_char *)_heap, __minheap_obj_size(_heap), = _idx, \ - _func, _args) + __min_heap_del_inline(container_of(&(_heap)->nr, min_heap_char, nr), \ + __minheap_obj_size(_heap), _idx, _func, _args) =20 void __min_heap_init(min_heap_char *heap, void *data, int size); void *__min_heap_peek(struct min_heap_char *heap); @@ -433,25 +436,31 @@ bool __min_heap_del(min_heap_char *heap, size_t elem_= size, size_t idx, const struct min_heap_callbacks *func, void *args); =20 #define min_heap_init(_heap, _data, _size) \ - __min_heap_init((min_heap_char *)_heap, _data, _size) + __min_heap_init(container_of(&(_heap)->nr, min_heap_char, nr), _data, _si= ze) #define min_heap_peek(_heap) \ - (__minheap_cast(_heap) __min_heap_peek((min_heap_char *)_heap)) + (__minheap_cast(_heap) __min_heap_peek(container_of(&(_heap)->nr, min_hea= p_char, nr))) #define min_heap_full(_heap) \ - __min_heap_full((min_heap_char *)_heap) + __min_heap_full(container_of(&(_heap)->nr, min_heap_char, nr)) #define min_heap_sift_down(_heap, _pos, _func, _args) \ - __min_heap_sift_down((min_heap_char *)_heap, _pos, __minheap_obj_size(_he= ap), _func, _args) + __min_heap_sift_down(container_of(&(_heap)->nr, min_heap_char, nr), _pos,= \ + __minheap_obj_size(_heap), _func, _args) #define min_heap_sift_up(_heap, _idx, _func, _args) \ - __min_heap_sift_up((min_heap_char *)_heap, __minheap_obj_size(_heap), _id= x, _func, _args) + __min_heap_sift_up(container_of(&(_heap)->nr, min_heap_char, nr), \ + __minheap_obj_size(_heap), _idx, _func, _args) #define min_heapify_all(_heap, _func, _args) \ - __min_heapify_all((min_heap_char *)_heap, __minheap_obj_size(_heap), _fun= c, _args) + __min_heapify_all(container_of(&(_heap)->nr, min_heap_char, nr), \ + __minheap_obj_size(_heap), _func, _args) #define min_heap_pop(_heap, _func, _args) \ - __min_heap_pop((min_heap_char *)_heap, __minheap_obj_size(_heap), _func, = _args) + __min_heap_pop(container_of(&(_heap)->nr, min_heap_char, nr), \ + __minheap_obj_size(_heap), _func, _args) #define min_heap_pop_push(_heap, _element, _func, _args) \ - __min_heap_pop_push((min_heap_char *)_heap, _element, __minheap_obj_size(= _heap), \ - _func, _args) + __min_heap_pop_push(container_of(&(_heap)->nr, min_heap_char, nr), _eleme= nt, \ + __minheap_obj_size(_heap), _func, _args) #define min_heap_push(_heap, _element, _func, _args) \ - __min_heap_push((min_heap_char *)_heap, _element, __minheap_obj_size(_hea= p), _func, _args) + __min_heap_push(container_of(&(_heap)->nr, min_heap_char, nr), _element, \ + __minheap_obj_size(_heap), _func, _args) #define min_heap_del(_heap, _idx, _func, _args) \ - __min_heap_del((min_heap_char *)_heap, __minheap_obj_size(_heap), _idx, _= func, _args) + __min_heap_del(container_of(&(_heap)->nr, min_heap_char, nr), \ + __minheap_obj_size(_heap), _idx, _func, _args) =20 #endif /* _LINUX_MIN_HEAP_H */ --=20 2.34.1 From nobody Fri Dec 27 00:25:22 2024 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAE2119F423; Fri, 29 Nov 2024 18:12:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732903959; cv=none; b=nCoPIWam6Trbbj/kG5YqkIgPGoCzQI1tvpF3e1eR35544+fd3Nd2c9MzrJivCDIdZfCBeRABFGJ8B7wmfGmtwwIRbaVDTbbz1BwZeyXSoJyx5PY+DCNeimIHHihXCyKhV/cv7Osb4MBHzWVCPACyqNPPtAb4vSXYn0dvdqhV1/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732903959; c=relaxed/simple; bh=65VjcgJ6W/nc4vLNB1ABhHSI9TMVRmLc7Ca4S3eBu00=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=F7VvjFe6JoMJH0qIeRw6xvmTd0aNLjYPc8IfCASwW8kjzsZhB5wCZaMhx07epq0artwaYByGF2b4R57Xb1OEyKdR7RuWLi5AX3lHKe+aYfU265SEy7Ikr503IFaum/eoUOXr6T8G/JF2rOKZ4c2jaF4W3R36uj7ZqCsCaBVyj7U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NK4Ql+DB; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NK4Ql+DB" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-21260209c68so21857405ad.0; Fri, 29 Nov 2024 10:12:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732903957; x=1733508757; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=j36qtzndjNfXOAp4ucPUgDYXmWkpix8KUSuouNFEhiE=; b=NK4Ql+DBqJmkP7OQhOvIo6yw8Tb3CDaAsEgLbzH6ONdGV1uGpcf6NZZGfZIFqip0vf UA1xMKv8wkS7DGP7GKq7UwaGoYkglDu/TgwqjAWn6qCPZKzWrttGcGUxkSYfVUlDYgd3 C+ZubdKQ3LyUKa5GyFRLgpsjEcOtn7lQoft4SrRYKYVGo4N2RqHQ401X0KYr+ZbhWAFu XxN4aXamDyfewXJZv4ekzowj4KGPFqrxFh67lItuCqoiQt+zOTBj0I5dANyzijIKLwKq voWwAvK9mYI1B1nTjSA4mICkLFtBi0/DNt1BwmZ0i/DRueJhWEJ6uI/8wAeLFMBfvdfa F82g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732903957; x=1733508757; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j36qtzndjNfXOAp4ucPUgDYXmWkpix8KUSuouNFEhiE=; b=TUDAmchpEBunyBoWw+LByqap3OEuubIkJGITyYJW3m4xzEu73qs4kciohqvjAP/KNo 2la1fwqWNTuWrKeRu8Af/PgvWP2vDR9ZrZfr5peDruZbfNWMmJKRnCFBTkW7dV8JBAOl TEBIoDDXdqHB+JFJtLYb8uPY0OAu7kBNvAL+14B6rrWAflLWXPlgs/b7ZAI2I+0d51QL 4Tev/kj13i+rRgQsBXYyXKZJ0grzMswCfOleBf51na4Vs9NeCHF2qnkJh5S6GnNl4rG6 GqrktIY1MotydhalzzQ0QdvXS0aLYIxbP9nGF3M+SXkglRUzNgowJffmITQp+PYOyuQh m1YQ== X-Forwarded-Encrypted: i=1; AJvYcCVkdxUW/m7Ik8x7/BvzXU2Z9hyShQS/wd9P3kBc1wIbiPWx02Abkw/eL5AltzBIQrl6HmC3n24G+BE=@vger.kernel.org, AJvYcCWuLdzbgz9j0RPuuH+yWhz0d/kooetn4g6PHjAApBGNCtQAAxNiESnxO8H5XezQnYMn5CYMZaUXVXr+oVyn@vger.kernel.org X-Gm-Message-State: AOJu0YzzGM83kedOB81tfc9Ixq8FyEjtDAh2oRQpvDyD04QRar0OngM1 OCoI5bJIN1pFqECiSf5tY5h6Gb1RSSyVMKzrDd1Q3ZfLLuA/VIvx X-Gm-Gg: ASbGnctaEz3YlVnlbp2fW+Pe31H7TZj2izbQJxJOmwY3qWiXkijgDj/rI+zum4S/9Mm olvaOhNIlUoERjF+52GW4SIRzhbj0mMBRrHgl5KkdmlsCTOrUMx6KJkQQnj1X2Cl6s44Zqn39wi m+JMFNHbUuNbRF9GK5SN2GMivUDS3d4BuNh16mWbPd/8PHgwN1nutN6sNa9gdJqhxbomDptznyl lXEpGdhMNcw9wmK7nhnrTsmytaYR+k8+wOCMxojHj0b9gvviEE+N3Q5Ptiq/K4QahLazq1FHrOi KM9w X-Google-Smtp-Source: AGHT+IGfWF1zsFEaT/OEkL2tM23xJkcNnTjYHquCHSMTXSLbO2BgDhFqVHJxzAIQe2wbP9ZIzC7ZHg== X-Received: by 2002:a17:902:dac4:b0:20b:6c1e:1e13 with SMTP id d9443c01a7336-2151d884f23mr105771405ad.23.1732903956938; Fri, 29 Nov 2024 10:12:36 -0800 (PST) Received: from visitorckw-System-Product-Name.. ([140.113.216.168]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72541761474sm3760595b3a.32.2024.11.29.10.12.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 10:12:36 -0800 (PST) From: Kuan-Wei Chiu To: akpm@linux-foundation.org, corbet@lwn.net Cc: geert@linux-m68k.org, jserv@ccns.ncku.edu.tw, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Kuan-Wei Chiu Subject: [PATCH 2/4] lib/test_min_heap: Use inline min heap variants to reduce attack vector Date: Sat, 30 Nov 2024 02:12:20 +0800 Message-Id: <20241129181222.646855-3-visitorckw@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241129181222.646855-1-visitorckw@gmail.com> References: <20241129181222.646855-1-visitorckw@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" To address concerns about increasing the attack vector, remove the select MIN_HEAP dependency from TEST_MIN_HEAP in Kconfig.debug. Additionally, all min heap test function calls in lib/test_min_heap.c are replaced with their inline variants. By exclusively using inline variants, we eliminate the need to enable CONFIG_MIN_HEAP for testing purposes. Link: https://lore.kernel.org/lkml/CAMuHMdVO5DPuD9HYWBFqKDHphx7+0BEhreUxtVC= 40A=3D8p6VAhQ@mail.gmail.com Suggested-by: Geert Uytterhoeven Signed-off-by: Kuan-Wei Chiu --- lib/Kconfig.debug | 1 - lib/test_min_heap.c | 30 +++++++++++++++--------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index f340017585c5..83a25c3220c9 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -2269,7 +2269,6 @@ config TEST_LIST_SORT config TEST_MIN_HEAP tristate "Min heap test" depends on DEBUG_KERNEL || m - select MIN_HEAP help Enable this to turn on min heap function tests. This test is executed only once during system boot (so affects only boot time), diff --git a/lib/test_min_heap.c b/lib/test_min_heap.c index e6fbb798558b..a9c4a74d3898 100644 --- a/lib/test_min_heap.c +++ b/lib/test_min_heap.c @@ -32,7 +32,7 @@ static __init int pop_verify_heap(bool min_heap, int last; =20 last =3D values[0]; - min_heap_pop(heap, funcs, NULL); + min_heap_pop_inline(heap, funcs, NULL); while (heap->nr > 0) { if (min_heap) { if (last > values[0]) { @@ -48,7 +48,7 @@ static __init int pop_verify_heap(bool min_heap, } } last =3D values[0]; - min_heap_pop(heap, funcs, NULL); + min_heap_pop_inline(heap, funcs, NULL); } return err; } @@ -69,7 +69,7 @@ static __init int test_heapify_all(bool min_heap) int i, err; =20 /* Test with known set of values. */ - min_heapify_all(&heap, &funcs, NULL); + min_heapify_all_inline(&heap, &funcs, NULL); err =3D pop_verify_heap(min_heap, &heap, &funcs); =20 =20 @@ -78,7 +78,7 @@ static __init int test_heapify_all(bool min_heap) for (i =3D 0; i < heap.nr; i++) values[i] =3D get_random_u32(); =20 - min_heapify_all(&heap, &funcs, NULL); + min_heapify_all_inline(&heap, &funcs, NULL); err +=3D pop_verify_heap(min_heap, &heap, &funcs); =20 return err; @@ -102,14 +102,14 @@ static __init int test_heap_push(bool min_heap) =20 /* Test with known set of values copied from data. */ for (i =3D 0; i < ARRAY_SIZE(data); i++) - min_heap_push(&heap, &data[i], &funcs, NULL); + min_heap_push_inline(&heap, &data[i], &funcs, NULL); =20 err =3D pop_verify_heap(min_heap, &heap, &funcs); =20 /* Test with randomly generated values. */ while (heap.nr < heap.size) { temp =3D get_random_u32(); - min_heap_push(&heap, &temp, &funcs, NULL); + min_heap_push_inline(&heap, &temp, &funcs, NULL); } err +=3D pop_verify_heap(min_heap, &heap, &funcs); =20 @@ -135,22 +135,22 @@ static __init int test_heap_pop_push(bool min_heap) /* Fill values with data to pop and replace. */ temp =3D min_heap ? 0x80000000 : 0x7FFFFFFF; for (i =3D 0; i < ARRAY_SIZE(data); i++) - min_heap_push(&heap, &temp, &funcs, NULL); + min_heap_push_inline(&heap, &temp, &funcs, NULL); =20 /* Test with known set of values copied from data. */ for (i =3D 0; i < ARRAY_SIZE(data); i++) - min_heap_pop_push(&heap, &data[i], &funcs, NULL); + min_heap_pop_push_inline(&heap, &data[i], &funcs, NULL); =20 err =3D pop_verify_heap(min_heap, &heap, &funcs); =20 heap.nr =3D 0; for (i =3D 0; i < ARRAY_SIZE(data); i++) - min_heap_push(&heap, &temp, &funcs, NULL); + min_heap_push_inline(&heap, &temp, &funcs, NULL); =20 /* Test with randomly generated values. */ for (i =3D 0; i < ARRAY_SIZE(data); i++) { temp =3D get_random_u32(); - min_heap_pop_push(&heap, &temp, &funcs, NULL); + min_heap_pop_push_inline(&heap, &temp, &funcs, NULL); } err +=3D pop_verify_heap(min_heap, &heap, &funcs); =20 @@ -163,7 +163,7 @@ static __init int test_heap_del(bool min_heap) -3, -1, -2, -4, 0x8000000, 0x7FFFFFF }; struct min_heap_test heap; =20 - min_heap_init(&heap, values, ARRAY_SIZE(values)); + min_heap_init_inline(&heap, values, ARRAY_SIZE(values)); heap.nr =3D ARRAY_SIZE(values); struct min_heap_callbacks funcs =3D { .less =3D min_heap ? less_than : greater_than, @@ -172,9 +172,9 @@ static __init int test_heap_del(bool min_heap) int i, err; =20 /* Test with known set of values. */ - min_heapify_all(&heap, &funcs, NULL); + min_heapify_all_inline(&heap, &funcs, NULL); for (i =3D 0; i < ARRAY_SIZE(values) / 2; i++) - min_heap_del(&heap, get_random_u32() % heap.nr, &funcs, NULL); + min_heap_del_inline(&heap, get_random_u32() % heap.nr, &funcs, NULL); err =3D pop_verify_heap(min_heap, &heap, &funcs); =20 =20 @@ -182,10 +182,10 @@ static __init int test_heap_del(bool min_heap) heap.nr =3D ARRAY_SIZE(values); for (i =3D 0; i < heap.nr; i++) values[i] =3D get_random_u32(); - min_heapify_all(&heap, &funcs, NULL); + min_heapify_all_inline(&heap, &funcs, NULL); =20 for (i =3D 0; i < ARRAY_SIZE(values) / 2; i++) - min_heap_del(&heap, get_random_u32() % heap.nr, &funcs, NULL); + min_heap_del_inline(&heap, get_random_u32() % heap.nr, &funcs, NULL); err +=3D pop_verify_heap(min_heap, &heap, &funcs); =20 return err; --=20 2.34.1 From nobody Fri Dec 27 00:25:22 2024 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F7581A254E; Fri, 29 Nov 2024 18:12:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732903961; cv=none; b=RCaOQCDc6q7c97zJOqmeb0mG0QTo2yfKIDUpPgfQVTFj+L1Uu05KbBwiG+2tPITEXvrrKFoLwhZNRQuT83sBJzX28E9OE0+kAXaphKOAJSJHx3b78gjWWCD9tr0eFJ3Y9XnCtHgKdvx3R9n+0IsYBB+Ck12i35WuB+U0i+rxAyI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732903961; c=relaxed/simple; bh=y766mzDXewnG0JbivJcEUbCpwpgfpvFzr7+qqNz4Gdk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YlQL7UZWIbLmBaR+VYfNoEmpvjrYRPG5cmD7FdoYoa7oiYgQtvsUUBBH/rTe/uTA12umY9sEHovoDKLVkcYngzHRiVN+vr6NvpVr71UpRQMBhI99rOaKiG2qskAGj73ESRHgMzOY4z6LXIqF6dUGPRGi+ThK9qofvdT8kux0Zqo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jAgqBXrm; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jAgqBXrm" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-212581a0b33so18398805ad.0; Fri, 29 Nov 2024 10:12:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732903960; x=1733508760; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bfX+yFdeCQxzje6xRTY7LEEi8jAxpPxXrlMB+dlCPJA=; b=jAgqBXrmrUKMKTI6FEPPHxdMtXTiCvilufZvKxYpCi/WBnsotXDwtmapvkBUT9O6pv yehyLwCl4lL7qF1E7sPIPWuYGheGlXtRSs/RdYhxiZps8wB1VbWS01uhNPa1bpztF901 CXKDQ/rEYsWVNKJgs5cVUpVves0SCEeqORWK/ceKct5ylXMVI9G7EE1XXUSTWDHBBlop gWcK0ZM8zGN26x8jmZatZCbvYh638kiv+G4z+PJpnXsPdHHlRea1e/0e0cCXRY12FeHo Yov+uyQZ2efJUdIL8bK9Cy80Nt4YwDJNamY1j/UP+KuFaPIAneOHQYBx90bAQWIMX3T0 h7Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732903960; x=1733508760; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bfX+yFdeCQxzje6xRTY7LEEi8jAxpPxXrlMB+dlCPJA=; b=BuO7BO2dH3uVH3NIHODHG3eXuIPNOm61ItJURmeGDpGO4qqBsHr2XkIT3zQuzxrhoP UV6il/sH+Bp90rJdKRFEitHt1LyKtCX9rzNO+S/GO2od34OhD4igw+MeN0cex5DnJUg0 1wYeJcsjk1FmEEtIz/ofinKoM7u0/miiaQ7MpdXnY2sRqHTAUax18dxl/sI+4gJPLNUz aej8ShJ/3DiLPi2oH/gJlerbR9aspOp3JU2jzoVgLydUbxlq0owodVqpc4N6InnffqwS ncczZJP4VKGWyX/Ry/6wfvjJfKJ082wT61JUsRlekwCw/n6d+2B2usXgRiVTjzRUhg/p jkKQ== X-Forwarded-Encrypted: i=1; AJvYcCWaPqYexSXJdPerGlSF/dC3OEGDJVxNtVZqQXXCd2/KFTYEhZ1TYhPiSUxm4IfbBV5YvU9UVjxVsXs=@vger.kernel.org, AJvYcCXa+kzlqxyRH8ApuFUYQ/SHAmVIPzU8jlJxOBqF0oSXBEqHw7fY9EhdfuRjUROdaqq1r+7EbBqPRkZrneyC@vger.kernel.org X-Gm-Message-State: AOJu0Yzx+LSsTCpjUPPfduDSq+HmRGAl10UIRiM7j4AR0NRnRO0SSwhl Sr50D8EcNRggriGN+23UYlOkDL9gmCdOuN/ApzQ1lPkFQuSvV90y X-Gm-Gg: ASbGncvhJMeMiSw1cE6p2WHQIj0vf4+SWEiD2uXDs3i8XbpQQxinF87850jSEndOuJn N/Juyc9w94sp5RzaKeWSw9lDq5WZxZSoXUeH5qwkA+O2ZXvH+S4+WO8/6ApJMhWY67uV//99aGy IcS5hGP4Hic5jFjlg8Q+OC5CqWR0Y5zg/lh/pNo3ZWS7iNYv0VSZMYgIUrhBV2AKkSl4H7cqXKI z5ig31rNGl77JvWm+Ic/HfmTeW39FWcOA3Gtv+foZKkt20bQIvt9SQHgIbdWDAqVgPFKvr3Hecn Ho51 X-Google-Smtp-Source: AGHT+IFf/+4gqeKFLs4tGMa7xUdxdMBgjAL+jG4Am5nBgS4kO81kw7uAfZjauW+bG8mPt3gJXuYqyg== X-Received: by 2002:a17:90b:1c0a:b0:2ea:8295:cd0d with SMTP id 98e67ed59e1d1-2ee08ecd368mr16247054a91.20.1732903959683; Fri, 29 Nov 2024 10:12:39 -0800 (PST) Received: from visitorckw-System-Product-Name.. ([140.113.216.168]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72541761474sm3760595b3a.32.2024.11.29.10.12.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 10:12:39 -0800 (PST) From: Kuan-Wei Chiu To: akpm@linux-foundation.org, corbet@lwn.net Cc: geert@linux-m68k.org, jserv@ccns.ncku.edu.tw, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Kuan-Wei Chiu Subject: [PATCH 3/4] lib min_heap: Add brief introduction to Min Heap API Date: Sat, 30 Nov 2024 02:12:21 +0800 Message-Id: <20241129181222.646855-4-visitorckw@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241129181222.646855-1-visitorckw@gmail.com> References: <20241129181222.646855-1-visitorckw@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" A short description of the Min Heap API is added to the min_heap.h, explaining its purpose for managing min-heaps and emphasizing the use of macro wrappers instead of direct function calls. For more details, users are directed to the documentation at Documentation/core-api/min_heap.rst. Signed-off-by: Kuan-Wei Chiu --- include/linux/min_heap.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/min_heap.h b/include/linux/min_heap.h index 456cfbc1b8f5..55bfe670bbb9 100644 --- a/include/linux/min_heap.h +++ b/include/linux/min_heap.h @@ -6,6 +6,17 @@ #include #include =20 +/* + * The Min Heap API provides utilities for managing min-heaps, a binary tr= ee + * structure where each node's value is less than or equal to its children= 's + * values, ensuring the smallest element is at the root. + * + * Users should avoid directly calling functions prefixed with __min_heap_= *(). + * Instead, use the provided macro wrappers. + * + * For further details and examples, refer to Documentation/core-api/min_h= eap.rst. + */ + /** * Data structure to hold a min-heap. * @nr: Number of elements currently in the heap. --=20 2.34.1 From nobody Fri Dec 27 00:25:22 2024 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FA301A3029; Fri, 29 Nov 2024 18:12:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732903964; cv=none; b=Bh5+nu3D7ujtwaDmXXCvXHy9GJPNGwK+hFxDd/s/HEd96b3ILy2/vBEGIeEyLPQOph2VVueXXuuASMCTt/M3I2C/8K3Ya3kY46nJCVOR7SU35orcmNcQ1ltXHxvmzjAcq+dIdBE0d+WhdYKDHs+GbPICfih+noaP4pmhP4mGCag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732903964; c=relaxed/simple; bh=kqVZcxr2geErHNMu4AkYEihsdaciCYHXfKJSpStpvsg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hhSXqwAOREPjAqWmwF5DGvtA/lZpPeZY1aJ/I+OGJVPWRdbxrQfWE1bVav2oSofSItn/J+yhwm+Eb9dZ1tsMv/8eSN8Yr4DdcHup1NdfKEJEPzwuf4ga4bagoVM4PhqSHrNVfcZmNkL8u6+8sxc+mRMox5CC2vu41WPcRnUvT4w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=O9aAWFHe; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O9aAWFHe" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-7251331e756so2049252b3a.3; Fri, 29 Nov 2024 10:12:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732903962; x=1733508762; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MQjvmlBmTnpWwrzaJhwRwR0HEjEbZNM9WpX61TT7FQA=; b=O9aAWFHej8eeC3D0S9g0I89a8qQO4br8eGJwdoLHvORFQMdE9RZTTW/0Dq5uZoBrP2 ncDkAimyhlHWQTpFF/Iugupf8m8geeWZH4FMrNail1+IxntVsgAfUwFgId3G01+ywQ7d sXGsissUlK2Tto3njjZeGFOSlWQmr1xElj9HetPyWocJLIvntEjAnYzFauAiQbE++0qJ IpyoD/J0ZGlNsezfsUua/+x6Wr9UhQrlipsyrepmqk4bbx4D0+lpQny2WNOsxtjFeV/A q7fUIs2l0n/TJsbrhyCXe/9gOJYtOb7z4B+T6ZnLhe2v8H/LKLrInsBGY7fcadzTrdj8 ub9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732903962; x=1733508762; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MQjvmlBmTnpWwrzaJhwRwR0HEjEbZNM9WpX61TT7FQA=; b=hcVSSPmFmBXb93nXZkg+plPgHaOEvWS0SLMnCLTMlrASWYEm7HQUi0TAIlNXtC6994 vicWvb+3QKzd3E7TBWY0pcukwuIo23hZ/QQy01J22bYhTpVdrbec3Y37nXEYrhbeSdtt hBjLSj1p9fCu+KJ/CJagrSAEpl7xa94VEcbCUUjlCEZXmiYYjSE46jRd2FMnhzt3fKnC J9zcWkbaX6YjPdLPhEtKiPo1RKpCcnAOXg1GWCsOi+uRUaVoR9RhwfNlbwLl0OrSy0zm F41dflDPxj5c7ln3I1pGJ4S9fn5DNgwGRZQJdrcQ6SVytmSnTzap9olqZ91LqTTAN+Tz RvKg== X-Forwarded-Encrypted: i=1; AJvYcCV+QF0Uzy1vzWUizckf7GMEXpC89j3SoKJUA+Bi4HFaO570fM/oukPRDFkginJGq2+gQEYWgYADwEA=@vger.kernel.org, AJvYcCW9gQeNXgGJOy1UTDWP1Sp641RPBAbvMaGxl8n4upBUshQFs2GhErIvavxtoOvbDYjLfwp/3WyM3EQBHk5m@vger.kernel.org X-Gm-Message-State: AOJu0Yxzh04h/hOmdaNaHrsBK5CdmCPYONtd1gmcl6Ak7BNbDuGTIRjl JOQH1CNKsO+PXDBi8eklDoTcd1JrAH9hJC14uv5VMT19N3K9WlY8 X-Gm-Gg: ASbGncv3S9SX8jHHaR0dyYbjquHh6ojfnhPptzr3EhrUKIa/m2XItNkKZB5k89MK3be UALFgbMeGnB6zVhU4z71CjJCpBOXrmJGiGk3v2RQ/Hb7lwp32GsotR211XtUNJvN4T+5187T246 l7HAtsfLd6WhcZ2Z5lcjs5qdPFXtGXJOtQs1FM7Iun3foXNHpthTLiEweQ5lhONtCL+ifs1zLv6 l3lsbWz6+48EtfvJaEmJAOCogdRz2380Lp2evfXYJIWlnwx2y9lEUiaAObsplQkgJ1aT4Txo74w eXzV X-Google-Smtp-Source: AGHT+IH/K8ZMuW/Bx3jxlL8mjJ+wh9wYspjBuH2mgSskUDwiwkMEladJvo9ngd+NtfbVAj7Go8vStA== X-Received: by 2002:a05:6a00:3d4e:b0:71e:4930:1620 with SMTP id d2e1a72fcca58-7253001506amr17016895b3a.3.1732903962497; Fri, 29 Nov 2024 10:12:42 -0800 (PST) Received: from visitorckw-System-Product-Name.. ([140.113.216.168]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72541761474sm3760595b3a.32.2024.11.29.10.12.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 10:12:42 -0800 (PST) From: Kuan-Wei Chiu To: akpm@linux-foundation.org, corbet@lwn.net Cc: geert@linux-m68k.org, jserv@ccns.ncku.edu.tw, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Kuan-Wei Chiu Subject: [PATCH 4/4] Documentation/core-api: min_heap: Add author information Date: Sat, 30 Nov 2024 02:12:22 +0800 Message-Id: <20241129181222.646855-5-visitorckw@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241129181222.646855-1-visitorckw@gmail.com> References: <20241129181222.646855-1-visitorckw@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" As with other documentation files, author information is added to min_heap.rst, providing contact details for any questions regarding the Min Heap API or the document itself. Signed-off-by: Kuan-Wei Chiu --- Documentation/core-api/min_heap.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/core-api/min_heap.rst b/Documentation/core-api/m= in_heap.rst index 0c636c8b7aa5..683bc6d09f00 100644 --- a/Documentation/core-api/min_heap.rst +++ b/Documentation/core-api/min_heap.rst @@ -4,6 +4,8 @@ Min Heap API =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 +:Author: Kuan-Wei Chiu + Introduction =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 --=20 2.34.1