public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kuan-Wei Chiu <visitorckw@gmail.com>
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 <visitorckw@gmail.com>
Subject: [PATCH 3/4] lib min_heap: Add brief introduction to Min Heap API
Date: Sat, 30 Nov 2024 02:12:21 +0800	[thread overview]
Message-ID: <20241129181222.646855-4-visitorckw@gmail.com> (raw)
In-Reply-To: <20241129181222.646855-1-visitorckw@gmail.com>

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 <visitorckw@gmail.com>
---
 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 <linux/string.h>
 #include <linux/types.h>
 
+/*
+ * The Min Heap API provides utilities for managing min-heaps, a binary tree
+ * 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_heap.rst.
+ */
+
 /**
  * Data structure to hold a min-heap.
  * @nr: Number of elements currently in the heap.
-- 
2.34.1


  parent reply	other threads:[~2024-11-29 18:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29 18:12 [PATCH 0/4] lib min_heap: Improve min_heap safety, testing, and documentation Kuan-Wei Chiu
2024-11-29 18:12 ` [PATCH 1/4] lib min_heap: Improve type safety in min_heap macros by using container_of Kuan-Wei Chiu
2024-11-29 18:12 ` [PATCH 2/4] lib/test_min_heap: Use inline min heap variants to reduce attack vector Kuan-Wei Chiu
2024-11-29 18:12 ` Kuan-Wei Chiu [this message]
2024-11-29 18:12 ` [PATCH 4/4] Documentation/core-api: min_heap: Add author information Kuan-Wei Chiu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241129181222.646855-4-visitorckw@gmail.com \
    --to=visitorckw@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=geert@linux-m68k.org \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox