linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: akpm@linux-foundation.org, walken@google.com
Cc: linux-mm@kvack.org, Wei Yang <richard.weiyang@gmail.com>
Subject: [PATCH] lib/interval-tree: add header guard in interval_tree_generic.h
Date: Sat, 15 Feb 2025 02:37:39 +0000	[thread overview]
Message-ID: <20250215023739.19809-1-richard.weiyang@gmail.com> (raw)

Per my understanding, we usually define header guard to prevent multiple
definition.

Let's add it as usual.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 include/linux/interval_tree_generic.h       | 4 ++++
 tools/include/linux/interval_tree_generic.h | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/include/linux/interval_tree_generic.h b/include/linux/interval_tree_generic.h
index aaa8a0767aa3..475595e50ef1 100644
--- a/include/linux/interval_tree_generic.h
+++ b/include/linux/interval_tree_generic.h
@@ -6,6 +6,8 @@
 
   include/linux/interval_tree_generic.h
 */
+#ifndef _LINUX_INTERVAL_TREE_GENERIC_H
+#define _LINUX_INTERVAL_TREE_GENERIC_H
 
 #include <linux/rbtree_augmented.h>
 
@@ -185,3 +187,5 @@ ITPREFIX ## _iter_next(ITSTRUCT *node, ITTYPE start, ITTYPE last)	      \
 			return node;					      \
 	}								      \
 }
+
+#endif	/* _LINUX_INTERVAL_TREE_GENERIC_H*/
diff --git a/tools/include/linux/interval_tree_generic.h b/tools/include/linux/interval_tree_generic.h
index aaa8a0767aa3..9499e4b2fff6 100644
--- a/tools/include/linux/interval_tree_generic.h
+++ b/tools/include/linux/interval_tree_generic.h
@@ -7,6 +7,9 @@
   include/linux/interval_tree_generic.h
 */
 
+#ifndef _TOOLS_LINUX_INTERVAL_TREE_GENERIC_H
+#define _TOOLS_LINUX_INTERVAL_TREE_GENERIC_H
+
 #include <linux/rbtree_augmented.h>
 
 /*
@@ -185,3 +188,5 @@ ITPREFIX ## _iter_next(ITSTRUCT *node, ITTYPE start, ITTYPE last)	      \
 			return node;					      \
 	}								      \
 }
+
+#endif	/* _TOOLS_LINUX_INTERVAL_TREE_GENERIC_H*/
-- 
2.34.1



             reply	other threads:[~2025-02-15  2:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-15  2:37 Wei Yang [this message]
2025-02-15  2:48 ` Matthew Wilcox

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=20250215023739.19809-1-richard.weiyang@gmail.com \
    --to=richard.weiyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=walken@google.com \
    /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