]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
memblock tests: Fix mutex related build error
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Mon, 7 Apr 2025 01:43:51 +0000 (10:43 +0900)
committerMike Rapoport (Microsoft) <rppt@kernel.org>
Mon, 7 Apr 2025 06:28:01 +0000 (09:28 +0300)
Fix mutex and free_reserved_area() related build errors which have
been introduced by commit 74e2498ccf7b ("mm/memblock: Add reserved
memory release function").

Fixes: 74e2498ccf7b ("mm/memblock: Add reserved memory release function")
Reported-by: Wei Yang <richard.weiyang@gmail.com>
Closes: https://lore.kernel.org/all/20250405023018.g2ae52nrz2757b3n@master/
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/174399023133.47537.7375975856054461445.stgit@devnote2
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
tools/testing/memblock/internal.h
tools/testing/memblock/linux/mutex.h [new file with mode: 0644]

index 1cf82acb2a3e4d4613441b68bd43bb1566f456d9..0ab4b53bb4f32a7fbbb5a6ed27ef21543316c0b2 100644 (file)
@@ -24,4 +24,10 @@ static inline void accept_memory(phys_addr_t start, unsigned long size)
 {
 }
 
+static inline unsigned long free_reserved_area(void *start, void *end,
+                                              int poison, const char *s)
+{
+       return 0;
+}
+
 #endif
diff --git a/tools/testing/memblock/linux/mutex.h b/tools/testing/memblock/linux/mutex.h
new file mode 100644 (file)
index 0000000..ae3f497
--- /dev/null
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _MUTEX_H
+#define _MUTEX_H
+
+#define DEFINE_MUTEX(name) int name
+
+static inline void dummy_mutex_guard(int *name)
+{
+}
+
+#define guard(mutex)   \
+       dummy_##mutex##_guard
+
+#endif /* _MUTEX_H */
\ No newline at end of file